package monadlib

  1. Overview
  2. Docs

The plus operation of the inner monoid should be i commutative, or alternatively, values should only be extracted by an embedding into a commutative monoid such as sort.

Parameters

module M : sig ... end

Signature

include Stream with type 'a t = 'a M.m LazyList.node_t and type 'a m = 'a M.m LazyList.t
type 'a t = 'a M.m LazyList.node_t
include BaseLazyPlus with type 'a m = 'a t Stdlib.Lazy.t with type 'a m = 'a M.m LazyList.t
include BatInterfaces.Monad with type 'a m = 'a t Stdlib.Lazy.t with type 'a m = 'a M.m LazyList.t
type 'a m = 'a M.m LazyList.t

The type of a monad producing values of type 'a.

val bind : 'a m -> ('a -> 'b m) -> 'b m

Monadic binding.

bind m f executes first m then f, using the result of m.

val zero : unit -> 'a m
val lplus : 'a m -> 'a m Stdlib.Lazy.t -> 'a m
val null : 'a m -> bool

null x implies that x is zero. If you do not want to or cannot answer whether a given x is zero, then null x should be false.

val iterate : ('a m -> 'a m) -> 'a m -> 'a m

The sum of the stream [f x, f (f x), f (f (f x)),...]

val delay : 'a m -> 'a m

Delay to prevent deadlock.

val to_depth : int -> 'a m -> 'a m

Search to some depth.

include Applicative.Base with type 'a m := 'a m
val return : 'a -> 'a m
val ap : ('a -> 'b) m -> 'a m -> 'b m
OCaml

Innovation. Community. Security.