[GHC] #10772: Type operator variable in prefix notation fails

#10772: Type operator variable in prefix notation fails -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 (Parser) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- 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 :: [(*)] -> Maybe (*) 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 ‘*’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10772 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10772: Type operator variable in prefix notation fails -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by nomeata: Old description:
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 :: [(*)] -> Maybe (*) 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 ‘*’ }}}
New description: 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 ‘*’ }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10772#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10772: Type operator variable in prefix notation fails -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Documentation | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * component: Compiler (Parser) => Documentation Comment: 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?) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10772#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10772: Type operator variable in prefix notation fails
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Documentation | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Documentation | Unknown/Multiple
bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#10772: Type operator variable in prefix notation fails -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.3 Component: Documentation | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * milestone: => 7.10.3 Comment: May as well merge. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10772#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10772: Type operator variable in prefix notation fails -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Documentation | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10772#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC