Fuzion Logo
flang.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 a plain or as a oneway monad to store a state
in a way orthogonal to the actual compuation.

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 Object.asString:

monadic operator

Same as non-generic >>=, but also maps to a different type B.

monadic operator

redefines monad.infix >>=:
monadic operator within the same monad

Apply f to elements of type A and re-wrap them in this monad.

map this using f

modify the state, leaving the contents unchanged

set state to new, leaving the contents unchanged

return function