[Haskell-cafe] Multiple Interpretations for a monad?

David Leimbach leimy2k at gmail.com
Thu Feb 25 10:50:14 EST 2010

Monads aren't necessarily EDSLs by themselves but are often shipped with
functions that provide what would make them an EDSL.  Take the State monad,
it has at least a get and a put function to work with the state in the
monad.  That get and put are commands that function only within the domain
of the State monad, and therefore could be thought of as an embedded
language that is used to work with the state encapsulated in the State Monad

The way I like to think of it, a Monad provides an environment or a context
within which it is very convenient to express an EDSL, and that this style
of coding should be encouraged!  :-)


2010/2/25 Günther Schmidt <gue.schmidt at web.de>

> Hi everyone,
> in my attempts to remove boilerplate and thus to do more "abstraction" I
> come across a number of interesting things and suggestions.
> Especially blog posts from Dan Piponi and also Heinrich Apfelmus. I think
> what they both are saying is that you can construct / implement some sort of
> 2 layered monad which can then have more than one interpretation.
> In the responses to one of my posts on DSLs Dan Piponi also points out that
> he considers monads also to be DSLs. It didn't click with me when he said
> it, but reading more of his blog posts made me remember that.
> Now I know this is probably something obvious to most haskellers, but to me
> it's not.
> Did I understand this correctly so far?
> Günther
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100225/3901c367/attachment.html

More information about the Haskell-Cafe mailing list