package clarity

  1. Overview
  2. Docs
type ('l, 'r) t =
  1. | Left of 'l
  2. | Right of 'r

Either.t represents value of two exclusive possibilities

val _Left : 'a -> ('a, 'b) t
val _Right : 'a -> ('b, 'a) t
include Monad.S2 with type ('l, 'r) t := ('l, 'r) t
include Monad.Basic2 with type ('p, 'a) t := ('p, 'a) t
include Applicative.Basic2 with type ('p, 'a) t := ('p, 'a) t
include Functor.Basic2 with type ('p, 'a) t := ('p, 'a) t
val bind : ('a -> ('p, 'b) t) -> ('p, 'a) t -> ('p, 'b) t
include Applicative.S2 with type ('p, 'a) t := ('p, 'a) t
include Applicative.Basic2 with type ('p, 'a) t := ('p, 'a) t
include Functor.Basic2 with type ('p, 'a) t := ('p, 'a) t
val pure : 'a -> ('p, 'a) t
val ap : ('p, 'a -> 'b) t -> (unit -> ('p, 'a) t) -> ('p, 'b) t
include Functor.S2 with type ('p, 'a) t := ('p, 'a) t
include Functor.Basic2 with type ('p, 'a) t := ('p, 'a) t
val map : ('a -> 'b) -> ('p, 'a) t -> ('p, 'b) t
val (>|=) : ('p, 'a) t -> ('a -> 'b) -> ('p, 'b) t
val replace : 'a -> ('p, 'b) t -> ('p, 'a) t
val void : ('p, 'a) t -> ('p, unit) t
val ap' : ('p, 'a -> 'b) t -> ('p, 'a) t -> ('p, 'b) t
val (<*>) : ('p, 'a -> 'b) t -> ('p, 'a) t -> ('p, 'b) t
val (<~>) : ('p, 'a -> 'b) t -> (unit -> ('p, 'a) t) -> ('p, 'b) t
val discard_left : ('p, 'a) t -> (unit -> ('p, 'b) t) -> ('p, 'b) t
val discard_right : ('p, 'a) t -> (unit -> ('p, 'b) t) -> ('p, 'a) t
val repeat : int -> ('p, 'a) t -> ('p, 'a list) t
val repeat_ : int -> ('p, 'a) t -> ('p, unit) t
val forever : ('p, 'a) t -> ('p, 'b) t
val (>>=) : ('p, 'a) t -> ('a -> ('p, 'b) t) -> ('p, 'b) t
val join : ('p, ('p, 'a) t) t -> ('p, 'a) t
val mcompose : ('b -> ('p, 'c) t) -> ('a -> ('p, 'b) t) -> 'a -> ('p, 'c) t
val bimap : ('a -> 'b) -> ('c -> 'd) -> ('a, 'c) t -> ('b, 'd) t
val fold : ('a -> 'b) -> ('c -> 'b) -> ('a, 'c) t -> 'b
val swap : ('a, 'b) t -> ('b, 'a) t
val maybe_left : ('a, 'b) t -> 'a option
val maybe_right : ('a, 'b) t -> 'b option
OCaml

Innovation. Community. Security.