Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Monad

Name: Anonymous 2011-07-31 16:15

hey /prog/, could someone explain the concept of a monad to a C programmer?

Name: Anonymous 2011-07-31 22:41

http://community.schemewiki.org/?monadic-programming
>Short version:
Pattern for using functions to transmit state without mutation.
>Longer version:
The basic principle is just that you can build up state by passing closures around, adding to the state contained in each closure by creating a new closure containing the extra state and invoking the original closure as necessary.
Monads just formalize that into a pattern with a specific set of operations. Part of the monad pattern is setting things up so you don't have to explicitly pass the state from function to function, it's handled behind the scenes.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List