[GHC] #15305: Erroneous "non-exhaustive pattern match" using nested GADT with strictness annotation

GHC ghc-devs at haskell.org
Thu Jul 26 12:55:15 UTC 2018


#15305: Erroneous "non-exhaustive pattern match" using nested GADT with strictness
annotation
-------------------------------------+-------------------------------------
        Reporter:  jkoppel           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  Research
       Component:  Compiler (Type    |  needed
  checker)                           |              Version:  8.4.3
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 I think this would work fine for simple, non-recursive examples like the
 original program, but I fail to see how this would work for recursive
 examples like the program in comment:7. If you have the constraint
 `NonVoid(Abyss)`, how do you conclude that that is contradictory?
 Presumably, you'd need some sort of way to determine if there are any
 terminating inhabitants of `Abyss`. Unlike the `InL` example, where the
 type of its field alone (`Foo B`) is enough to conclude that it is
 uninhabitable, nothing about the type of `MkAbyss`'s field (`Abyss`)
 suggests that it is uninhabitable, so you'd have to check if its field
 satisfies the constraint `NonVoid(Abyss)`. But that brings us back to the
 infinite loop in comment:7.

 In short, I just don't see how this is possible to do in a way that's
 complete.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15305#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list