package clarity

  1. Overview
  2. Docs

List data type

type 'a t = 'a list
val _Cons : 'a -> 'a list -> 'a list
val _Nil : 'a list
val iter : ('a -> unit) -> 'a t -> unit
val append : 'a t -> 'a t -> 'a t
val length : 'a t -> int
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val intersperse : 'a -> 'a list -> 'a list
val rev : 'a t -> 'a t
val rev_append : 'a t -> 'a t -> 'a t
val rev_map : ('a -> 'b) -> 'a t -> 'b t
val rev_mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t

Stable sort with supplied comparision function, default is Pervasives.compare

include Monad.S with type 'a t := 'a t
include Monad.Basic with type 'a t := 'a t
include Applicative.Basic with type 'a t := 'a t
include Functor.Basic with type 'a t := 'a t
val bind : ('a -> 'b t) -> 'a t -> 'b t
include Applicative.S with type 'a t := 'a t
include Applicative.Basic with type 'a t := 'a t
include Functor.Basic with type 'a t := 'a t
val pure : 'a -> 'a t
val ap : ('a -> 'b) t -> (unit -> 'a t) -> 'b t
include Functor.S with type 'a t := 'a t
include Functor.Basic with type 'a t := 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val replace : 'a -> 'b t -> 'a t
val void : 'a t -> unit t
val ap' : ('a -> 'b) t -> 'a t -> 'b t
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
val (<~>) : ('a -> 'b) t -> (unit -> 'a t) -> 'b t
val discard_left : 'a t -> (unit -> 'b t) -> 'b t
val discard_right : 'a t -> (unit -> 'b t) -> 'a t
val repeat : int -> 'a t -> 'a list t
val repeat_ : int -> 'a t -> unit t
val forever : 'a t -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val join : 'a t t -> 'a t
val mcompose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
include Foldable.S with type 'a t := 'a t
include Foldable.Basic with type 'a t := 'a t
val foldl : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val foldr : ('a -> (unit -> 'b) -> 'b) -> (unit -> 'b) -> 'a t -> 'b
val foldr' : ('a -> 'b -> 'b) -> 'b -> 'a t -> 'b
val fold_map : (module Monoid.S with type t = 'm) -> ('a -> 'm) -> 'a t -> 'm
val any : ('a -> bool) -> 'a t -> bool
val all : ('a -> bool) -> 'a t -> bool
val find : ('a -> bool) -> 'a t -> 'a option
include Align.S with type 'a t := 'a t
include Align.Basic with type 'a t := 'a t
val align_with : (('a, 'b) These.t -> 'c) -> 'a t -> 'b t -> 'c t
val align : 'a t -> 'b t -> ('a, 'b) These.t t
val falign : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t
val pad_zip_with : ('a option -> 'b option -> 'c) -> 'a t -> 'b t -> 'c t
val pad_zip : 'a t -> 'b t -> ('a option * 'b option) t
module A (A : Applicative.Basic) : Traversable.S with type 'a t := 'a t and type 'a f := 'a A.t
module A2 (A : Applicative.Basic2) : Traversable.S2 with type 'a t := 'a t and type ('u, 'a) f := ('u, 'a) A.t
module A3 (A : Applicative.Basic3) : Traversable.S3 with type 'a t := 'a t and type ('u, 'v, 'a) f := ('u, 'v, 'a) A.t
module M (M : Monad.Basic) : sig ... end
module M2 (M : Monad.Basic2) : sig ... end
module M3 (M : Monad.Basic3) : sig ... end