infix operators in Sequence.Infix

This commit is contained in:
Simon Cruanes 2013-03-07 19:48:22 +01:00
parent b109e99c00
commit ba3564c2bb
2 changed files with 21 additions and 0 deletions

View file

@ -582,6 +582,17 @@ module TypeClass = struct
fold addable.add addable.empty seq
end
(** {2 Infix functions} *)
module Infix = struct
let (--) i j = int_range ~start:i ~stop:j
let (|>) x f = f x
let (@@) a b = append a b
let (>>=) x f = flatMap f x
end
(** {2 Pretty printing of sequences} *)

View file

@ -319,6 +319,16 @@ module TypeClass : sig
val to_addable : ('a,'b) addable -> 'a t -> 'b
end
(** {2 Infix functions} *)
module Infix : sig
val (--) : int -> int -> int t
val (|>) : 'a -> ('a -> 'b) -> 'b
val (@@) : 'a t -> 'a t -> 'a t
end
(** {2 Pretty printing of sequences} *)
val pp_seq : ?sep:string -> (Format.formatter -> 'a -> unit) ->