aL_ wrote:how do you do ui(say a textbox) without mutable state?
So monads convert functions from this
int f(int x)
to this
int* f(int x)
where int* is int plus some encapsulation of relevant things that don't fit into your functional model, e.g., I/O, mutable state, etc. Lambda functions are then used to transform int* back into int.
int* => int
The lambda functions allow the converted functions to seem monoidal like the original functions by isolating their side effects from the original functions.
JChung2006 wrote:So monads convert functions from this int f(int x) to this int* f(int x) where int* is int plus some encapsulation of relevant things that don't fit into your functional model, e.g., I/O, mutable state, etc. Lambda functions are then used to transform int* back into int.int* => int The lambda functions allow the converted functions to seem monoidal like the original functions by isolating their side effects from the original functions.