
I'm being hit by undecidable instances, but I can't see why. I read and reread the GHC docs on MPTCs, but to no avail. This is what I'm trying to do: newtype S a = S a instance MArray IOUArray a IO => MArray IOUArray (S a) IO where ... the instance declaration is basically just wrapping/unwrapping S and a few castIOArrays. However, GHC complains: /nfs/isd/hdaume/projects/MESumm/Linear2/Linear2.hs:76: Non-type variables in constraint: MArray IOUArray a IO (Use -fallow-undecidable-instances to permit this) In the context: (MArray IOUArray a IO) While checking the context of an instance declaration In the instance declaration for `MArray IOUArray (S a) IO' But I don't see why this is undecidable. As I understand it, undecidable instances basically arise when context reduction might not terminate. Here, it always will (AFAICS). Any thoughts? - Hal
participants (1)
-
Hal Daume III