[Haskell-beginners] Help with type declaration using MArray
perry.james at computer.org
Mon Apr 18 04:38:17 CEST 2011
I'm working through Brown & Cook's "Monadic Memoization Mixins" and have
come across some code that I can't get to compile with GHC.
The error I get for
arrayDict :: (*MArray *arr (*Maybe *b) m, *Ix *a, *Ord *a)
=> a -> arr a (*Maybe *b) -> *Dict *a b m
Non type-variable argument
in the constraint: MArray arr (Maybe b) m
(Use -XFlexibleContexts to permit this)
In the type signature for `arrayDict':
arrayDict :: (MArray arr (Maybe b) m, Ix a, Ord a) =>
a -> arr a (Maybe b) -> Dict a b m
Enabling FlexibleContexts causes other errors. What could be going wrong?
In case this isn't enough context, I've posted the full source code for this
section of the paper at
Thanks in advance for any help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners