+
+ module type LIST = sig
+ include MONADZERO with type 'a result = 'a list
+ val (++) : 'a t -> 'a t -> 'a t (* monadically append *)
+ val pick : 'a t -> ('a * 'a t) t (* monadically pick each element *)
+ val test : ('a list -> bool) -> 'a t -> 'a t
+ end
+
+ module type LISTT = sig
+ type 'a uresult
+ include MONADZEROT with type 'a result = 'a list uresult
+ val (++) : 'a t -> 'a t -> 'a t (* monadically append *)
+ val pick : 'a t -> ('a * 'a t) t (* monadically pick each element *)
+ val test : ('a list ut -> bool) -> 'a t -> 'a t
+ (*
+ Monadically seq k over box<a>.
+ OptionM.seq (List.map (\a -> OptionM.mid $ a+1) int_list) == (after running)
+ ListOption.distribute (\a -> OptionM.mid $ a+1) int_list == Some [x+1,x+1,...]
+ TreeOption.distribute (\a -> OptionM.mid $ a+1) int_tree: works similarly
+ *)
+ val distribute : ('a -> 'b ut) -> 'a list -> 'b t
+ end
+