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

handles2

🌌handles2

handles2 provide a means to create handles that refer to update-able
cells.

handles is a state monad. It provides features to create several
handles that refer to modifiable value and features to 'get', 'put' or
'update' this value.

For performance, this implementation uses mutable state. It can consequently
only be used as a one-way monad.

get the value refered to by a given handle

has one element been created using 'new'?


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

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

return the last handle that was created by 'new'

create a new instance with one additional handle

the new handle can be accessed by 'result.last'

create a new instance with new value refered to by a given handle

create a new instance with the value refered to by a given handle read and
updated.