[GHC] #13470: Pattern synonyms bind variables out of scope

GHC ghc-devs at haskell.org
Thu Mar 23 10:31:06 UTC 2017


#13470: Pattern synonyms bind variables out of scope
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.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:
-------------------------------------+-------------------------------------
 Wasn't sure what to call this ticket:

 {{{#!hs
 {-# Language PatternSynonyms #-}

 pattern XInstrProxy :: (Bool -> Bool) -> a
 pattern XInstrProxy not <- _
 }}}

 This works fine, is it intended? It came as some surprise to me when I was
 renaming type variables only to find it still working even though I hadn't
 changed the variable in the `ViewPattern`

 {{{#!hs
 import Data.Tagged

 pattern XInstrProxy proxy <- ((\(Proxy::Proxy descr) -> Proxy::Proxy
 (XInstr descr)) -> ty)
 }}}

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


More information about the ghc-tickets mailing list