this repo has no description
at main 21 lines 505 B view raw
1type 'a tree = { node : 'a; children : 'a forest } 2and 'a forest = 'a tree list 3 4val leaf : 'a -> 'a tree 5 6module type S = sig 7 type 'a t 8 9 val fold_left : f:('acc -> 'a -> 'acc) -> 'acc -> 'a t -> 'acc 10 val iter : f:('a -> unit) -> 'a t -> unit 11 val map : f:('a -> 'b) -> 'a t -> 'b t 12 val to_json : ('a -> Json.json) -> 'a t -> Json.json 13end 14 15include S with type 'a t = 'a tree 16 17module Forest : sig 18 include S with type 'a t = 'a forest 19 20 val filter_map : f:('a -> 'b option) -> 'a t -> 'b t 21end