Free monads
John Wiegley
johnw
Thu Oct 3 21:18:51 UTC 2013
>>>>> Andres L?h <andres at well-typed.com> writes:
> I'll follow Simon's lead, and ask a similar question with a similar
> motivation. I'm going to talk about free monads at the upcoming Haskell
> eXchange next Wednesday. I'll not limit myself to a particular library, and
> I'm open to related approaches (e.g. "operational") as well.
One way I think about is: for the same reason you might want to pass around a
list of numbers, rather than a sum or a length -- i.e., so that consume those
numbers in multiple, different ways -- so too you might want to pass a list of
"effects" (do this, do this, then do that) rather than a single, composite
effect. In this sense, the free monad is just a free monoid in the category
of endofunctors, and offers the same utility.
--
John Wiegley
FP Complete Haskell tools, training and consulting
http://fpcomplete.com johnw on #haskell/irc.freenode.net
More information about the Libraries
mailing list