Header menu logo Nu

Chain Module

Chain operators.

Functions and values

Function or value Description

advance c e world

Full Usage: advance c e world

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

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

c : 'e -> Chain<'e, 'a>
e : 'e
world : World
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:
Returns: Chain<'e, unit>

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

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

get

Full Usage: get

Returns: Chain<'e, World>

Get the world.

Returns: Chain<'e, World>

getBy by

Full Usage: getBy by

Parameters:
Returns: Chain<'e, 'a>

Get the world as transformed via 'by'.

by : World -> 'a
Returns: Chain<'e, 'a>

loop i step pred c

Full Usage: loop i step pred c

Parameters:
    i : 'i
    step : 'i -> 'i
    pred : 'i -> World -> 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 -> World -> 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:
Returns: Chain<'e, unit>

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

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

reactData expr

Full Usage: reactData expr

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

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

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

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

reactEvent expr

Full Usage: reactEvent expr

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

Returns: Chain<'e, unit>

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

expr : 'e -> World -> 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 world

Full Usage: step c world

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

Step once into a chain.

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

update expr

Full Usage: update expr

Parameters:
Returns: Chain<'e, unit>

Update the world.

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

updateBy by expr

Full Usage: updateBy by expr

Parameters:
Returns: Chain<'e, unit>

Update the world with an additional transformed world parameter.

by : World -> 'a
expr : 'a -> World -> unit
Returns: Chain<'e, unit>

Type something to start searching.