[GHC] #11986: Record fields not defined with pattern synonym in ghci

GHC ghc-devs at haskell.org
Tue Apr 26 21:28:30 UTC 2016


#11986: Record fields not defined with pattern synonym in ghci
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  PatternSynonyms                    |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Another thing discovered while in the air: When you define pattern
 synonyms with record syntax, the fields aren't defined in GHCI:

 {{{#!hs
 $ ghci -ignore-dot-ghci -XPatternSynonyms
 GHCi, version 8.1.20160419: http://www.haskell.org/ghc/  :? for help
 Prelude> pattern Point {x, y} = (x, y)
 Prelude> :t x

 <interactive>:1:1: error: Variable not in scope: x
 Prelude>
 }}}

 Works fine when imported from a file.

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


More information about the ghc-tickets mailing list