Commit 278f3697 authored by Aliaume Lopez's avatar Aliaume Lopez

Rewriting huge progress

parent 7e2f733a
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -60,20 +60,21 @@ let rec zipWith f l1 l2 = match (l1,l2) with
| (a::c, b::d) -> (f a b) :: (zipWith f c d);;
(*
* Place un morceau de texte des deux côtés
* d'un texte
*
* Utile pour composer avec des fonctions
* Put surroundings to a string
* Usefull in long function composition
* chain
*
* WARNING: intended behaviour,
* if the string is empty, does NOT
* put any surroundings
*
* ATTENTION: ne met entre p et q
* que si la chaine est non vide !
* (pratique)
*)
let surround p q s =
if s = "" then "" else p ^ s ^ q;;
(**
* permute les lignes d'un vecteur
* Swap lines of a vector
*)
let permute_lignes i j v =
let tmp = v.(i) in
......@@ -91,6 +92,7 @@ let array_find f a =
done;
!c;;
(* option trying combinator *)
let (<|>) a b = match a with
| Some x -> a
| None -> b;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment