Given the following program:
{-
I get this warning from GHC 7.4.2 when using -fwarn-incomplete-patterns for the generic function f defined above:
Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: BarB _
Of course, it makes no sense to even try to add a match for BarB :
Couldn't match type `'False' with `'True' Inaccessible code in a pattern with constructor BarB :: forall (foo :: Foo). IsA foo ~ 'False => String -> Bar foo, in a case alternative In the pattern: BarB _ In a case alternative: BarB _ -> undefined In the expression: case bar of { BarA x -> x BarB _ -> undefined }
Is there a way to convince the GHC that f is shared? Also, this is a GHC bug or just a known limitation; or is there really a very good reason why there is no way to see that the pattern matching in f complete?
Cactus
source share