Free monads

Daniel Díaz Carrete diaz.carrete
Thu Oct 3 18:51:40 UTC 2013

Andres L?h <andres <at>> writes:

> Hi everyone.
> 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.
> I'm also looking for as many compelling examples as possible. Like
> Simon, I don't want to know anything secret or anything that you
> wouldn't like me to include in my talk. Most useful are pointers to
> existing libraries using free monads that I might have missed (for
> example, because they're new or very specialized).
> Thanks a lot for your help in advance.
> Cheers,
>   Andres

I my "pianola" package, I use a free monad (in module Pianola.Protocol) to 
abstract away the connection details of RPC calls, along with the 
reading/writing from the handles.

I use another free monad (in module Pianola.Pianola, but not exported) to 
sequence observational interactions with an external object accessed through 
the network. The functor is the Kleisli arrow of a monad. The observations 
can return no results, or more than one result. Depending on the 
interpreter, more than one result can be treated as an error, or at least 
merit a warning. The current interpreter just chooses the first  result and 
keeps going.


More information about the Libraries mailing list