[GHC] #10404: GHC panic when creating a monomorphised pattern synonym for GADT

GHC ghc-devs at haskell.org
Tue Oct 20 20:16:58 UTC 2015


#10404: GHC panic when creating a monomorphised pattern synonym for GADT
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.10.1-rc1
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Linux             |         Architecture:  x86
 Type of failure:  GHC rejects       |            Test Case:
  valid program                      |
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 The panic is bad but the original example fails to compile because there
 is a misunderstanding with the signature. The following program compiles.

 {{{
 {-# LANGUAGE GADTs,PatternSynonyms #-}
 module Test where

 data Exp a where
   Fun :: (a -> b) -> (Exp a -> Exp b)

 pattern IntFun :: () => (a ~ Int) => (a -> b) -> (Exp a -> Exp b)
 pattern IntFun f x = Fun f x
 }}}

 Just giving one set of constraints correspond to provided constraints and
 an empty required constraints. In this case you want required constraints
 but empty provided constraints.

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


More information about the ghc-tickets mailing list