[GHC] #14135: PatternSynonyms regression in GHC HEAD (expectJust mkOneConFull)

GHC ghc-devs at haskell.org
Thu Sep 21 12:58:33 UTC 2017


#14135: PatternSynonyms regression in GHC HEAD (expectJust mkOneConFull)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  carlostome
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3981
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 This type-of-scrutinee check is interesting, but it would come at a cost.
 Currently, it is quite possible to use `Foo1` and `MyFoo2` together, in
 this function:

 {{{#!hs
 g :: Foo Int -> Int
 g (Foo1 x)   = x
 g (MyFoo2 y) = y
 }}}

 But if we adopted your proposed type-of-scrutinee validity check, then
 we'd no longer be able to write a `COMPLETE` program that covers this use
 case, since `{-# COMPLETE Foo1, MyFoo2 #-}` wouldn't typecheck.

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


More information about the ghc-tickets mailing list