[GHC] #11671: Allow labels starting with uppercase with OverloadedLabels
GHC
ghc-devs at haskell.org
Sat Mar 5 00:29:45 UTC 2016
#11671: Allow labels starting with uppercase with OverloadedLabels
-------------------------------------+-------------------------------------
Reporter: inaki | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1-rc1
(Parser) |
Resolution: | Keywords: ORF
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 inaki):
I should add one point: some of the possible constructors that we want to
overload can be fairly generic words (`Nothing`, for instance, is one).
Having the `#` character in front helps a lot in here, since it makes the
distinction between `Nothing` (constructor of `Maybe a` type) and
`#Nothing` (some pattern to be resolved depending on the usage location).
So creating patterns explicitly easily leads to name clashes with ordinary
constructors. To avoid this currently we add a final underscore (`Nothing`
-> `Nothing_`), but this final underscore is easy to forget, and not that
nice as a solution. Having a OverloadedLabels style solution would be much
nicer.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11671#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list