[GHC] #10932: Pattern synonyms and view pattern arguments

GHC ghc-devs at haskell.org
Mon Oct 5 07:54:58 UTC 2015


#10932: Pattern synonyms and view pattern arguments
-------------------------------------+-------------------------------------
           Reporter:  nomeata        |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |
-------------------------------------+-------------------------------------
 In my code, I had a few complicated patterns involving view patterns that
 depended on local arguments, i.e.
 {{{
 foo env (someView env -> Just x) = ...
 }}}

 I was hoping to be able to use PatternSynonyms to abstract and simplify
 this:
 {{{
 pattern Pat env x <- (someView env -> Just x)
 foo env (Pat env x) = ...
 }}}
 but it says `Not in scope: env`.

 It would be nice if I could use pattern synonyms here as well.

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


More information about the ghc-tickets mailing list