Skip to content

incomplete patterns and GADT

I would like to compile with 
-fwarn-incomplete-patterns and use GADTs, 
but I have bogus error messages. 
Suppose I define : 
 
data T a where 
    C1 :: T Char 
    C2 :: T Float 
 
then a function : 
 
exhaustive :: T Char -> Char 
exhaustive C1 = ' ' 
 
If I compile with incomplete pattern warnings, 
I get that my function "exhaustive" is not 
exhaustive. 
But if I add a case : 
 
exhaust C2 = ' ' 
 
then the compiler accurately warns me that this 
case is inaccessible. 
Would it be possible to add the accessibility check 
when compiling with incomplete patterns detection ? 
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information