On Thu, Aug 08, 2013 at 03:38:41PM +0200, Jerzy Karczmarczuk wrote:See [1] for an explanation of free monads in general. For IO in particular,
> >One could simply implement IO as a free monad
> Interesting. I wonder how.
define a functor
data IOF a = GetChar (Char -> a) | PutChar Char a | ...
with constructors for all elementary IO operations.