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.
Is there some way around? Either to somehow define the monad, or to
achieve the same functionality without using Map, which requires Ord
instances?
Not being allowed constraints on the variables for class methods is
probably the problem I have most frequently run into recently in
Haskell (is there any way to fix this, or does it open up a whole can
of worms?).