X-Git-Url: https://scm.cri.mines-paristech.fr/git/Faustine.git/blobdiff_plain/d8214dc258396483f72533504515a4e1d1b3deef..e77e9feca3956347ffeb6d58e97ec3b423ec99aa:/interpretor/aux.ml?ds=sidebyside diff --git a/interpretor/aux.ml b/interpretor/aux.ml index fccb904..3f75f06 100644 --- a/interpretor/aux.ml +++ b/interpretor/aux.ml @@ -6,6 +6,9 @@ *) +let array_map = fun f -> fun a -> + let n = Array.length a in + Array.init n (fun i -> f a.(i));; let array_map2 = fun f -> fun a -> fun b -> let n1 = Array.length a in @@ -19,3 +22,5 @@ let array_map3 = fun f -> fun a -> fun b -> fun c -> let n3 = Array.length c in if n1 = n2 && n1 = n3 then Array.init n1 (fun i -> f a.(i) b.(i) c.(i)) else raise (Invalid_argument "Array.map3 size not matched.");; + +let decorate = fun s -> " Faustine -> " ^ s;;