Making monads from transformed monads
lemming at henning-thielemann.de
Fri Mar 22 17:31:13 CET 2013
In a library I want to give a base monad and allow the user to choose a
monad transformer. However, the Monad.Trans.Class from transformers is
not strong enough, because it cannot warrant that a transformed monad is
a monads itself.
I have appended a module that implements a class with methods 'point'
and 'bind' that correspond to 'return' and '>>='. A backward-compatible
solution would be to add the class as subclass of current
Monad.Trans.Class. This is how I implemented my proof-of-concept. A
cleaner solution for the long run would be to add the methods 'point'
and 'bind' directly to the current Monad.Trans.Class.
Is there any interest in that extension or modification?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1343 bytes
Desc: not available
More information about the Libraries