
#11432: Cannot export operator newtype -------------------------------------+------------------------------------- Reporter: phadej | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by skvadrik): Turns out I was wrong in thinking that variable/type constructors appear in the same context: `(..)` is only allowed after type constructors (so goldfire was right about parenthesis and lookahead). GHC grammar allows invalid syntax like `(..)` after variable constructors: https://ghc.haskell.org/trac/ghc/browser/ghc/compiler/parser/Parser.y#L633 {{{ export :: { OrdList (LIE RdrName) } : qcname_ext export_subspec {% mkModuleImpExp $1 (snd $ unLoc $2) ... }}} `qcname_ext` here can be both variable/type constructor, and `export_subspec` can be `(..)`. This can (and should) be fixed in grammar so that non-ambiguous constructs like `(-.->)(..)` in export lists are accepted without `type` keyword. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11432#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler