[GHC] #9913: Discrepancy in type synonym definition and usage

#9913: Discrepancy in type synonym definition and usage -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler (Parser) | Version: 7.8.3 Keywords: | Operating System: Architecture: x86 | Unknown/Multiple Difficulty: Unknown | Type of failure: GHC Blocked By: | rejects valid program Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Minor consistency issue, the following compiles fine (note parentheses): {{{#!hs type Alg f a = f a -> a initial :: Alg(f) a initial = undefined }}} But changing the definition to mirror its use: {{{#!hs type Alg(f) a = f a -> a initial :: Alg(f) a initial = undefined }}} and it fails with: {{{#!hs Unexpected type ‘f’ In the type declaration for ‘Alg’ A type declaration should have form type Alg a b c = ... Failed, modules loaded: none. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9913 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9913: Discrepancy in type synonym definition and usage -------------------------------------+------------------------------------- Reporter: | Owner: Iceland_jack | Status: closed Type: bug | Milestone: Priority: lowest | Version: 7.8.3 Component: Compiler | Keywords: (Parser) | Architecture: x86 Resolution: invalid | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: GHC | rejects valid program | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by nomeata): * status: new => closed * resolution: => invalid Comment: Thanks for your report. I don’t think this is a bug. There is a conceptual difference between the declaration, where the argument to the type synonyms are declared (and hence have to be variables), and the use of a type synonym, where parameters are type expressions. Note that you can use `Alg Maybe`, but cannot define `type Alg Maybe a = Maybe a -> a`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9913#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9913: Discrepancy in type synonym definition and usage -------------------------------------+------------------------------------- Reporter: | Owner: Iceland_jack | Status: closed Type: bug | Milestone: Priority: lowest | Version: 7.8.3 Component: Compiler | Keywords: (Parser) | Architecture: x86 Resolution: invalid | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: GHC | rejects valid program | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Agreed with what Joachim said, but moreover this falls under the purview of the Haskell 2010 Report, so a bug report of this sort should ideally be accompanied by a reference to section(s) of the Report that GHC is deviating from (in this instance, though I haven't checked, I imagine the Report specifies the behavior that GHC exhibits). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9913#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC