[GHC] #8581: Pattern synonym used in an expression context could have different constraints to pattern used in a pattern context

GHC ghc-devs at haskell.org
Mon Jul 25 03:18:00 UTC 2016


#8581: Pattern synonym used in an expression context could have different
constraints to pattern used in a pattern context
-------------------------------------+-------------------------------------
        Reporter:  cactus            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Replying to [comment:40 goldfire]:
 > But this idea opens up a new, heretofore undiscussed possibility, that
 of a pattern synonym that cannot be used as a pattern. In other words, it
 would just be a normal Haskell variable, except with a capitalized
 identifier. I personally think this is one bridge too far, encouraging
 people to use a capitalized word for ordinary functions. I think this
 would be confusing, and for what benefit?

 It emphasizes the orthogonality of pattern synonyms and constructor
 synonyms; I tend to find orthogonal features easier to understand. The
 current reuse of the `where` keyword to add a constructor synonym is also
 troubling. It would feel cleaner to me to let these be completely separate
 declarations.

 BTW, what ever happened to the idea of letting a module re-export a type
 and associate pattern synonyms with it? I lost track of that and haven't
 had a chance to upgrade to 8.0 yet.

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


More information about the ghc-tickets mailing list