A Monadic Realization
See, this finally sunk in today: monads are a way of writing DSLs in functional settings. Haskell’s do-notation serves much the same role for DSLs as Ruby’s block notation does. With monads, the semantics of the DSL are determined by how you define bind and return, supplemented by the other functions you’ve defined in the monad.