Header menu logo Nu

Chain Module

Chain operators.

Functions and values

Function or value Description

advance c e

Full Usage: advance c e

Parameters:
    c : 'e -> Chain<'e, 'a>
    e : 'e

Returns: Either<('e -> Chain<'e, 'a>), 'a>

Advance a chain value by one step, providing 'e'.

c : 'e -> Chain<'e, 'a>
e : 'e
Returns: Either<('e -> Chain<'e, 'a>), 'a>

apply c a

Full Usage: apply c a

Parameters:
Returns: Chain<'a, 'c>
Modifiers: inline
Type parameters: 'a, 'b, 'c

Functor map for the chain monad.

c : Chain<'a, ('b -> 'c)>
a : Chain<'a, 'b>
Returns: Chain<'a, 'c>

bind c a

Full Usage: bind c a

Parameters:
Returns: Chain<'a, 'c>
Modifiers: inline
Type parameters: 'a, 'b, 'c

Monadic bind for the chain monad.

c : Chain<'a, 'b>
a : 'b -> Chain<'a, 'c>
Returns: Chain<'a, 'c>

during pred c

Full Usage: during pred c

Parameters:
    pred : unit -> bool
    c : Chain<'e, unit>

Returns: Chain<'e, unit>

Loop in a chain context while 'pred' evaluates to true considering only the world state.

pred : unit -> bool
c : Chain<'e, unit>
Returns: Chain<'e, unit>

loop i step pred c

Full Usage: loop i step pred c

Parameters:
    i : 'i
    step : 'i -> 'i
    pred : 'i -> bool
    c : 'i -> Chain<'e, unit>

Returns: Chain<'e, unit>

Loop in a chain context while 'pred' evaluate to true considering only the loop data.

i : 'i
step : 'i -> 'i
pred : 'i -> bool
c : 'i -> Chain<'e, unit>
Returns: Chain<'e, unit>

map f a

Full Usage: map f a

Parameters:
    f : 'a -> 'b
    a : Chain<'c, 'a>

Returns: Chain<'c, 'b>
Modifiers: inline
Type parameters: 'a, 'b, 'c

Functor map for the chain monad.

f : 'a -> 'b
a : Chain<'c, 'a>
Returns: Chain<'c, 'b>

next

Full Usage: next

Returns: Chain<'e, 'e>

Get the next event.

Returns: Chain<'e, 'e>

pass

Full Usage: pass

Returns: Chain<'e, unit>

Pass over the next event.

Returns: Chain<'e, unit>

react expr

Full Usage: react expr

Parameters:
    expr : unit -> unit

Returns: Chain<'e, unit>

React to the next event, discarding the event's value.

expr : unit -> unit
Returns: Chain<'e, unit>

reactData expr

Full Usage: reactData expr

Parameters:
    expr : 'a -> unit -> unit

Returns: Chain<Event<'a, 's>, unit>

React to the next event, using the event's data in the reaction.

expr : 'a -> unit -> unit
Returns: Chain<Event<'a, 's>, unit>

reactEvent expr

Full Usage: reactEvent expr

Parameters:
    expr : 'e -> unit -> unit

Returns: Chain<'e, unit>

React to the next event, using the event's value in the reaction.

expr : 'e -> unit -> unit
Returns: Chain<'e, unit>

returnM a

Full Usage: returnM a

Parameters:
    a : 'a

Returns: Chain<'b, 'a>
Modifiers: inline
Type parameters: 'a, 'b

Monadic return for the chain monad.

a : 'a
Returns: Chain<'b, 'a>

step c

Full Usage: step c

Parameters:
Returns: Either<('e -> Chain<'e, 'a>), 'a>

Step once into a chain.

c : Chain<'e, 'a>
Returns: Either<('e -> Chain<'e, 'a>), 'a>

Type something to start searching.