let (|||) f g = fun x -> g (f x);;
let rec loop(c,f) = function x -> let r = f x in if c r then loop (c,f) r else r ;;
let mapvector (f,n) = (Array.map f);;
let curry f = fun x -> fun y -> f (x,y);;
let reducevector (f,n) v = let l = (Array.to_list v) in (List.fold_left (curry f) (List.hd l) (List.tl l));;