[GHC] #8915: Instance context not respected in pattern match

GHC ghc-devs at haskell.org
Wed Mar 19 23:57:55 UTC 2014


#8915: Instance context not respected in pattern match
-------------------------------------+------------------------------------
        Reporter:  heisenbug         |            Owner:
            Type:  bug               |           Status:  closed
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.9
      Resolution:  invalid           |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------
Changes (by goldfire):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This is not how instances work, I'm afraid. You've stated that
 `KnownSymbol a` implies `Foo (Just a)`, but not the other way around. So,
 pattern matching will bring `Foo (Just a)` into the context, but that says
 nothing about `KnownSymbol a`.

 I don't have a good reference of where to point you to explaining this in
 detail -- sorry.

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


More information about the ghc-tickets mailing list