CCList.(>|=) infix map

This commit is contained in:
Simon Cruanes 2014-11-06 16:08:36 +01:00
parent 73201a4e67
commit ed3bf4ba26
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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 *)