Opened 4 years ago

Closed 4 years ago

#10772 closed bug (fixed)

Type operator variable in prefix notation fails

Reported by: nomeata Owned by:
Priority: normal Milestone: 7.10.3
Component: Documentation Version: 7.11
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Documentation bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by nomeata)

Hi,

I’m not sure if this is me misreading the documentation at https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/data-type-extensions.html#infix-tycons (in which case maybe the wording can be improved) or an actual bug. But I would have expected this code

foo :: [(*)] -> Maybe (*)
foo _ = Nothing

to be equivalent to

foo :: [a] -> Maybe a
foo _ = Nothing

at least with -XNoTypeOperators. But independent of that flag, with GHC HEAD and 7.8, I get

/tmp/foo.hs:1:9: error: Not in scope: type constructor or class ‘*’

Change History (6)

comment:1 Changed 4 years ago by nomeata

Description: modified (diff)

comment:2 Changed 4 years ago by goldfire

Component: Compiler (Parser)Documentation

This is an error in the manual. The first bullet should read:

A type constructor or class can be any non-reserved operator. Symbols used in types are always type constructors or classes, never variables. Note that this is different from the lexical syntax of data constructors, which are required to begin with a :.

The behavior changed somewhat recently. (7.6?)

comment:3 Changed 4 years ago by thomie

Type of failure: None/UnknownDocumentation bug

comment:4 Changed 4 years ago by Richard Eisenberg <eir@…>

In d19a77ab/ghc:

Update user guide, fixing #10772

comment:5 Changed 4 years ago by goldfire

Milestone: 7.10.3
Status: newmerge

May as well merge.

comment:6 Changed 4 years ago by bgamari

Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.