Other Practical Monads

Learn about some practical monads, such as State, Writer, and List.

The State monad

A shared global state is amenable to mutation. A horde of undesired (often unmitigated) side effects can permeate through the global state through the routines and variables that use it. The essence of the State monad is the storage of an initial state and mutation of an existing one, usually an offshoot of an initial state.

Get hands-on with 1200+ tech skills courses.