package spotlib

  1. Overview
  2. Docs
type (+'a, 'z) t =
  1. | Return : 'a -> ('a, 'z) t
  2. | Bind : ('a, 'z) t * ('a -> ('b, 'z) t) -> ('b, 'z) t
include Monad.T2 with type ('a, 'z) t := ('a, 'z) t
include Monad_intf.S2 with type ('a, 'z) t := ('a, 'z) t
val return : 'a -> ('a, 'z) t
val bind : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
include Monad_intf.EX2 with type ('a, 'z) t := ('a, 'z) t
val fmap : ('a -> 'b) -> ('a, 'z) t -> ('b, 'z) t

fmap in Haskell

val liftM : ('a -> 'b) -> ('a, 'z) t -> ('b, 'z) t

Synonym of fmap

val fmap2 : ('a -> 'b -> 'c) -> ('a, 'z) t -> ('b, 'z) t -> ('c, 'z) t

fmap2 in Haskell

val liftM2 : ('a -> 'b -> 'c) -> ('a, 'z) t -> ('b, 'z) t -> ('c, 'z) t

synonym of fmap2 in Haskell

val void : ('a, 'z) t -> (unit, 'z) t
val seq : ('a, 'z) t list -> ('a list, 'z) t

sequence in Haskell. Not tail recursive.

val seq_ : (unit, 'z) t list -> (unit, 'z) t

sequence_ in Haskell. Not tail recursive.

val mapM : ('a -> ('b, 'z) t) -> 'a list -> ('b list, 'z) t

Not tail recursive

val mapM_ : ('a -> (unit, 'z) t) -> 'a list -> (unit, 'z) t

Not tail recursive

val iteri : (int -> 'a -> (unit, 'z) t) -> 'a list -> (unit, 'z) t

Iteration with index starting from 0. Not tail recursive.

val for_ : int -> int -> (int -> (unit, 'z) t) -> (unit, 'z) t

for like iteration. Not tail recursive

val join : (('a, 'z) t, 'z) t -> ('a, 'z) t
include Monad_intf.Infix2 with type ('a, 'z) t := ('a, 'z) t
val (>>=) : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t

synonym of bind

val (>>|) : ('a, 'z) t -> ('a -> 'b) -> ('b, 'z) t

synonum of fmap, with the flipped arguments

Applicative style binops

val (^<$>) : ('a -> 'b) -> ('a, 'z) t -> ('b, 'z) t

same as map, <$> in Haskell

val (/<*>) : ('a -> 'b, 'z) t -> ('a, 'z) t -> ('b, 'z) t

<*> in Haskell

module S : Monad_intf.S2 with type ('a, 'z) t := ('a, 'z) t
module EX : Monad_intf.EX2 with type ('a, 'z) t := ('a, 'z) t
module Infix : Monad_intf.Infix2 with type ('a, 'z) t := ('a, 'z) t
OCaml

Innovation. Community. Security.