Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

state

state

state -- represent a state using a monad

this can be used both as plain or as a oneway monad to store a state
in a way orthogonal to the actual computation.

Functions

converts option to a string

returns the result of $T for an option containing an instance
of T, alternatively returns $nil for an option that is nil.

redefines:

set state to new, leaving the contents unchanged
map this using f
return function
monadic operator

redefines:

monadic operator

Same as non-generic >>=, but also maps to a different type B.
modify the state, leaving the contents unchanged