[GHC] #9023: Error when using empty record update on binary pattern synonym

GHC ghc-devs at haskell.org
Wed Apr 23 17:23:53 UTC 2014


#9023: Error when using empty record update on binary pattern synonym
--------------------------------+---------------------------------
       Reporter:  Iceland_jack  |             Owner:
           Type:  bug           |            Status:  new
       Priority:  normal        |         Milestone:
      Component:  Compiler      |           Version:  7.8.2
       Keywords:                |  Operating System:  Linux
   Architecture:  x86           |   Type of failure:  None/Unknown
     Difficulty:  Unknown       |         Test Case:
     Blocked By:                |          Blocking:
Related Tickets:                |
--------------------------------+---------------------------------
 Using an empty record update with patterns works here

 {{{
 pattern Singleton a = [a]

 isSingleton :: [a] -> Bool
 isSingleton Singleton{} = True
 isSingleton _           = False
 }}}

 but fails in the follow example (there may exist a more minimal example)

 {{{
 pattern P a b = Just (a, b)
 foo P{} = True
 }}}

 which outputs (GHC 7.8.2)

 {{{
 $ ghci -ignore-dot-ghci tmp.g2WZtTUkhJ.hs
 GHCi, version 7.8.2: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 1] Compiling Main             ( tmp.g2WZtTUkhJ.hs, interpreted )
 Var/Type length mismatch:
     [t{tv aIW} [sk]]
     []
 Ok, modules loaded: Main.
 *Main>
 }}}

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


More information about the ghc-tickets mailing list