[Haskell-beginners] Re: Are monads pure?

Heinrich Apfelmus apfelmus at quantentunnel.de
Tue May 18 05:30:33 EDT 2010


Andres Loeh wrote:
> Nevertheless, people often refer to features such as state
> and exceptions as "effects", and hence sometimes call code that makes
> use of them "effectful" and code that does not "pure".

This makes sense if you think of monads as embedded domain specific
languages. In the jargon of, say the DSL corresponding to the state
monad, the operation  put  has an "effect". But the embedding into
Haskell maps  put  to a pure function of type  s -> ((),s) .


Regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com



More information about the Beginners mailing list