[GHC] #11367: [Regression] Only one clause allowed in (explicitly bidirectional) pattern synonyms

GHC ghc-devs at haskell.org
Thu Jan 7 15:56:14 UTC 2016


#11367: [Regression] Only one clause allowed in (explicitly bidirectional) pattern
synonyms
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Replying to [comment:10 mpickering]:
 > > Could you not view a where clause in a pattern synonym as containing
 zero bindings (unidirectional) or a single binding (explicitly
 bidirectional).
 >
 > Yes you could, without looking I think this would require quite a bit of
 refactoring because of how everything is dealt with in the parser.

 If we take the route of #393 a pattern synonym `where` could always
 indicate an explicitly bidirectional pattern with a single clause:

 {{{#!hs
 pattern A <- 'a' where

 ---expands-into-->

 pattern A <- 'a' where
         A = _
 }}}

 to Simon's point.

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


More information about the ghc-tickets mailing list