[GHC] #11671: Allow labels starting with uppercase with OverloadedLabels

GHC ghc-devs at haskell.org
Fri Mar 4 00:45:09 UTC 2016


#11671: Allow labels starting with uppercase with OverloadedLabels
-------------------------------------+-------------------------------------
           Reporter:  inaki          |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1-rc1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The following program
 {{{#!hs
 {-# LANGUAGE OverloadedLabels, DataKinds, FlexibleInstances,
   MultiParamTypeClasses #-}

 import GHC.OverloadedLabels

 instance IsLabel "Three" Int where
     fromLabel _ = 3

 test :: Int
 test = #Three

 main :: IO ()
 main = print test
 }}}
 fails to compile in ghc 8.0 with a parse error (while it works as expected
 if we replace "Three" -> "three"). This may be a conscious design
 decision, but if not I figured I would ask if it would be possible to
 allow such labels starting with uppercase letters.

 I run into this when working on adding support for OverloadedLabels to the
 gobject-introspection bindings (autogenerated bindings for gtk, etc.),
 where it would be natural in a few places to write overloaded labels
 starting with a capital letter. Not hugely important, but sometimes
 aesthetically more pleasing (imho), and I am not aware of a good reason to
 forbid them. Perhaps there is one?

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


More information about the ghc-tickets mailing list