Coverage Condition fails

Adrian Hey ahey at iee.org
Tue Jan 2 06:10:39 EST 2007


Simon Peyton-Jones wrote:
> The coverage condition is described in the paper
> http://research.microsoft.com/~simonpj/papers/fd-chr
> 
> Use -fallow-undecidable-instances to make it compile.

Thanks, it seems to compile now. I've had a quick look at
the paper you mentioned and I also see the latest ghc user
guide has something to say about this too. But I'm still
not really clear about what the problem is :-(

(But I haven't really had time to study the paper properly
yet either.)

> |  > -- Generalsed Trie map class
> |  > class Ord k => GT map k | map -> k , k -> map where
> |
> |  > -- Map type for pairs
> |  > newtype (GT2 map1 map2 a) = GT2 (map1 (map2 a))
> |
> |  > -- Which is an instance of GT
> |  > instance (GT map1 k1, GT map2 k2) => GT (GT2 map1 map2) (k1,k2) where

Intuitively, this looks quite unambigous to me and allowing undecidable
anything worries me a bit. It makes me think my code is inherently
flakey somehow (not sure how right now though :-).

Regards
--
Adrian Hey




More information about the Glasgow-haskell-users mailing list