
6 Nov
2009
6 Nov
'09
7:36 p.m.
Petr Pudlak wrote:
The problem is the (Ord b) condition, which is required for the Map functions. When I try to define the monad instance as
instance Monad Distrib where return = dreturn (>>=) = dcompose
obviously, I get an error at (>>=): Could not deduce (Ord b) from the context.
This is the same reason we do not have e.g. a Monad instance for Set. One solution is a concept of "restricted" monads, and one implementation of restricted monads is given here: http://okmij.org/ftp/Haskell/types.html#restricted-datatypes - Jake