
On Sun, Dec 02, 2012 at 07:56:57PM +0000, Gábor Lehel wrote:
Out of curiosity, to what degree does MultiParamTypeClasses have this issue? It seems to me like one of the few extensions which is straightforward, widely implemented, uncontroversial, and very useful.
There's some discussion of the linkages at http://hackage.haskell.org/trac/haskell-prime/wiki/MultiParamTypeClasses Without FlexibleInstances, each argument in an instance must be a type constructor applied to type variables, with no repetition of type variables across the head. That would rule out instances like these from the array packages: instance IArray Array e instance MArray (STArray s) e (ST s) instance Storable e => MArray StorableArray e Even without these, when reducing contexts you encounter situations where one argument has a type constructor and another is a type variable. So you have to change the notions of simple context and context reduction errors (section 4.5.3). GHC avoids that by deferring context reduction, but that opens a whole other can of worms.