[GHC] #10928: Refine pattern synonym signatures

GHC ghc-devs at haskell.org
Wed Oct 7 17:07:38 UTC 2015


#10928: Refine pattern synonym signatures
-------------------------------------+-------------------------------------
        Reporter:  mpickering        |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Replying to [comment:18 rwbarton]:
 > That's kind of weird. But you can write
 > {{{
 > pattern P :: a ~ Int => () => G a   -- current syntax; (Int ~ a) is
 provided constraint
 > pattern P = MkG
 > }}}
 > and then `pat` is accepted...

 Sure you can. But such a `P` is different from the one I defined. Very,
 very subtly different, but indeed different: matching on your `P` tells
 the type checker that `a ~ Int`, whereas matching on my `P` asks the type
 checker to prove `a ~ Int`.

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


More information about the ghc-tickets mailing list