
On Fri, Nov 6, 2009 at 10:19 AM, Neil Brown
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.
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?).
I believe this paper is intended to propose a solution: http://tomschrijvers.blogspot.com/2009/11/haskell-type-constraints-unleashed... Jason