Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
lib.ml
1 2 3 4 5 6 7 8 9 10 11 12 13
(** [fold (x::xs) z f] = [f x (fold xs z f)] **) let fold l z0 f = let rec loop z = function | [] -> z | x::xs -> loop (f x z) xs in loop z0 (List.rev l) (** [map [x; y; ...] f] = [f x; f y; ...] **) let rec map l f = match l with | [] -> [] | x::xs -> f x::map xs f