[GHC] #11199: Outdated documentation for type operators

GHC ghc-devs at haskell.org
Fri Dec 11 16:13:16 UTC 2015


#11199: Outdated documentation for type operators
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.0.1
          Component:  Documentation  |           Version:  7.11
           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:
-------------------------------------+-------------------------------------
 John Leo writes:

 According to sections 7.4.3 and 7.4.4 of the latest
 [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/data-
 type-extensions.html GHC documentation]
 you can define (7.4.3) an infix type constructor as long as it begins with
 a colon, for example

 {{{
 data a :*: b = Foo a b
 }}}

 and furthermore (7.4.4) you can define an infix operator without having to
 use a colon if you enable the `TypeOperators` extension:

 {{{
 data a * b = Foo a b
 }}}

 However if I try the former without using `TypeOperators` I get this
 compiler error in 7.10.2:

 {{{
     Illegal declaration of a type or class operator ‘:*:’
       Use TypeOperators to declare operators in type and declarations
 }}}

 Using `TypeOperators` fixes this, but then `*` without colon also works so
 I don't see the point of using colon anymore.

 My guess is this was some some kind of historical distinction which is no
 longer valid and the documentation needs to be updated.  Is this true, or
 am I missing something?

 -------------------------

 Answer: it's just historical and the documentation is wrong.

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


More information about the ghc-tickets mailing list