[GHC] #11046: lookupTypeName does not support type operators not starting with :

GHC ghc-devs at haskell.org
Thu Nov 5 11:21:56 UTC 2015


#11046: lookupTypeName does not support type operators not starting with :
-------------------------------------+-------------------------------------
        Reporter:  oerjan            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  Template Haskell  |              Version:  7.10.2
      Resolution:                    |             Keywords:
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 thomie):

 Relevant commit 85926ae6c63a62e4f23423f220588875c8f1ab45:
 {{{
 Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
 Date:   Sun Jan 8 16:33:51 2012 -0800

     Change -XTypeOperators to treat all type-operators as type-
 constructors.

     Previously, only type operators starting with ":" were type
 constructors,
     and writing "+" in a type resulted in a type variable.  Now, type
     variables are always ordinary identifiers, and all operators are
 treated
     as constructors.  One can still write type variables in infix form
 though,
     for example, "a `fun` b" is a type expression with 3 type variables:
 "a",
     "fun", and "b".

     Writing (+) in an import/export list always refers to the value (+)
     and not the type.   To refer to the type one can write either "type
 (+)",
     or provide an explicit suobrdinate list (e.g., "(+)()").  For clarity,
     one can also combine the two, for example "type (+)(A,B,C)" is also
     accepted and means the same thing as "(+)(A,B,C)" (i.e., export the
 type
     (+), with the constructors A,B,and C).
 }}}

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


More information about the ghc-tickets mailing list