package rea

  1. Overview
  2. Docs

Constant functor, products, and applicatives.

type 'c r

Abstract higher-kinded effect representation type constructor.

val to_rea : 'c -> ('c r, 'e, 'a) s

TODO

val of_rea : ('c r, 'e, 'a) s -> 'c

TODO

val from : 'c -> ('c r, 'e, 'a, 'D) er

from value has no effect aside from encapsulating the given value.

Constant functr
class ['c, 'D] functr : object ... end

Base constant functor interpreter dictionary.

val functr : ('c, 'D) functr as 'D

Default functr dictionary.

Constant applicatives
val conjunction : (bool r, 'D) applicative' as 'D

Combines booleans with && lazily.

val disjunction : (bool r, 'D) applicative' as 'D

Combines booleans with || lazily.

val option : ('c option r, 'D) applicative' as 'D

Combines options to return the leftmost some lazily.

val unit_er : (('R, 'e, unit, ['R, 'D] monad' as 'D) er r, 'S) applicative' as 'S

Combines unit effects with bind.

val conjunction_er : (('R, 'e, bool, ['R, 'D] monad' as 'D) er r, 'S) applicative' as 'S

Combines boolean effects with &&& lazily.

val disjunction_er : (('R, 'e, bool, ['R, 'D] monad' as 'D) er r, 'S) applicative' as 'S

Combines boolean effects with ||| lazily.

val option_er : (('R, 'e, 'c option, ['R, 'D] monad' as 'D) er r, 'S) applicative' as 'S

Combines option effects to return the leftmost some lazily.

User defined
val map : 'D -> ('c r, 'e, 'a, 'b, 'D) map'm

Use to implement the map capability for a constant functr.

val pure_of : 'c -> ('c r, 'e, 'a, 'D) pure'm

Use to implement the pure capability for a constant with the given identity element.

val pair_with : 'D -> 'c lazy_op'2 -> ('c r, 'e, 'a, 'b, 'D) pair'm

Use to implement the pair capability for a constant with the given binary combine operator.

class ['c, 'D] product : 'c lazy_op'2 -> object ... end

new product combine creates the dictionary for a constant product functr.

class ['c, 'D] applicative : 'c -> 'c lazy_op'2 -> object ... end

new applicative identity combine creates the dictionary for a constant applicative functr.

OCaml

Innovation. Community. Security.