Coverage Condition fails

Simon Peyton-Jones simonpj at microsoft.com
Mon Jan 1 12:45:08 EST 2007


The coverage condition is described in the paper
http://research.microsoft.com/~simonpj/papers/fd-chr

Use -fallow-undecidable-instances to make it compile.

Simoin

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of Adrian Hey
| Sent: 30 December 2006 23:26
| To: glasgow-haskell-users at haskell.org
| Subject: Coverage Condition fails
|
| Hello folks,
|
| Could somebody explain what a coverage condition is and
| what this error message means..
|
| "Illegal instance declaration for 'GT (GT2 map1 map2) (k1,k2)'
|    (the Coverage Condition fails for one of the functional dependencies)
|   In the instance declaration for 'GT (GT2 map1 map2) (k1,k2)'"
|
| The offending code looks like this..
|
|  > -- 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
|
| This is with ghc 6.6. The strange thing is this code used to compile
| fine with earlier versions (but I don't know if it actually worked
| because I never tested it).
|
| Thanks
| --
| Adrian Hey
|
|
|
|
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list