Quantcast
Channel: GADT's failed exhaustiveness checking - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by semicolon for GADT's failed exhaustiveness checking

As already mentioned. The case you are not handling is Inl _|_, which is not itself _|_, and thus must be handled.Luckily there is a perfectly nice way to handle this:data (:+:) f g a = Inl (f a) | Inr...

View Article



Answer by Ben for GADT's failed exhaustiveness checking

The problem actually reported is:Warning: Pattern match(es) are non-exhaustive In an equation for `fun': Patterns not matched: Inl _Which is true. You provide a case for the Inr constructor, but not...

View Article

Answer by C. A. McCann for GADT's failed exhaustiveness checking

I'm sorry to tell you this, but your first example is not quite as exhaustive as you think it is:∀x. x ⊢ fun (Inl (undefined :: Foo B))*** Exception: Test.hs:48:1-17: Non-exhaustive patterns in...

View Article

GADT's failed exhaustiveness checking

Consider the following code:data (:+:) f g a = Inl (f a) | Inr (g a)data Adata Bdata Foo l where Foo :: Foo Adata Bar l where Bar :: Bar Btype Sig = Foo :+: Barfun :: Sig B -> Intfun (Inr Bar) =...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>