diff --git a/core/CCList.ml b/core/CCList.ml index cddb1911..03713d62 100644 --- a/core/CCList.ml +++ b/core/CCList.ml @@ -51,6 +51,8 @@ let map f l = List.rev (List.rev_map f l) = map f l) *) +let (>|=) l f = map f l + let append l1 l2 = let rec direct i l1 l2 = match l1 with | [] -> l2 @@ -550,7 +552,7 @@ module type MONAD = sig end module Traverse(M : MONAD) = struct - open M + open! M let map_m f l = let rec aux f acc l = match l with diff --git a/core/CCList.mli b/core/CCList.mli index 65356855..939888c4 100644 --- a/core/CCList.mli +++ b/core/CCList.mli @@ -33,6 +33,10 @@ val empty : 'a t val map : ('a -> 'b) -> 'a t -> 'b t (** Safe version of map *) +val (>|=) : 'a t -> ('a -> 'b) -> 'b t +(** Infix version of [map] with reversed arguments + @since NEXT_RELEASE *) + val append : 'a t -> 'a t -> 'a t (** Safe version of append *)