[GHC] #13747: Can't use 'instance' keyword in associated type family instance

#13747: Can't use 'instance' keyword in associated type family instance -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts... #associated-instances The manual on type families says:]
When an associated data or type synonym family instance is declared within a type class instance, we (optionally) may drop the instance keyword in the family instance"
But that doesn't work for me. Using {{{ class Myclass a where type family MyFamily a :: * }}} then the code {{{ instance Myclass Mytype where type instance MyFamily Mytype = Int }}} doesn't compile but {{{ instance Myclass Mytype where type MyFamily Mytype = Int }}} I'd expect to be able to use the `instance` keyword here. I'd prefer this to be treated as an implementation bug instead of a doc bug, because I think it can be useful to be explicit for the ease of reading (and it work works the same way for class declaration, as the example also demonstrates). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13747 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13747: Can't use 'instance' keyword in associated type family instance -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => newcomer Comment: This sounds reasonable to me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13747#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13747: Can't use 'instance' keyword in associated type family instance -------------------------------------+------------------------------------- Reporter: nh2 | Owner: erdeszt Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3673 Wiki Page: | -------------------------------------+------------------------------------- Changes (by erdeszt): * owner: (none) => erdeszt * differential: => Phab:D3673 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13747#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13747: Can't use 'instance' keyword in associated type family instance
-------------------------------------+-------------------------------------
Reporter: nh2 | Owner: erdeszt
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
error/warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3673
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13747: Can't use 'instance' keyword in associated type family instance -------------------------------------+------------------------------------- Reporter: nh2 | Owner: erdeszt Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3673 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.4.1 Comment: Thanks erdeszt! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13747#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13747: Can't use 'instance' keyword in associated type family instance -------------------------------------+------------------------------------- Reporter: nh2 | Owner: erdeszt Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3673 Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): Indeed, thanks a lot! Come to Zurich, show me this ticket and I owe you a beverage of your choice. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13747#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC