Rea.Constant
Constant functor, products, and applicatives.
from value
has no effect aside from encapsulating the given value
.
class ['c, 'D] functr : object ... end
Base constant functor interpreter dictionary.
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.
Use to implement the map
capability for a constant functor.
Use to implement the pure
capability for a constant with the given identity
element.
Use to implement the pair
capability for a constant with the given binary combine
operator.
new product combine
creates the dictionary for a constant product functor.
class ['c, 'D] applicative : 'c -> 'c lazy_op'2 -> object ... end
new applicative identity combine
creates the dictionary for a constant applicative functor.