package clarity

  1. Overview
  2. Docs
type 'a t = 'a option

Monad instance for an option type

val _None : 'a option
val _Some : 'a -> 'a option
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
val fold : ('a -> 'b) -> 'b -> 'a option -> 'b
OCaml

Innovation. Community. Security.