[GHC] #9178: improve orphan instance warning

#9178: improve orphan instance warning ------------------------------------+------------------------------------- Reporter: fphh | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- The current warning `Warning: orphan instance: instance ClassName TypeName` could be improved by suggesting three solutions: (i) Move the instance declaration to the file, where the class has been declared (ii) Move the instance declaration to the file, where the Type has been declared (iii) Wrap the type with a newtype and declare the instance on the new type. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9178 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9178: improve orphan instance warning -------------------------------------+------------------------------------ Reporter: fphh | Owner: Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by fphh): * status: new => patch Comment: Finished, ready for review. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9178#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9178: improve orphan instance warning -------------------------------------+------------------------------------ Reporter: fphh | Owner: Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by fphh): This is how it looks like. What do you think? {{{ T9178.hs:8:10: Warning: Orphan instance: instance Show T9178_Type To avoid this move the instance declaration to the module of the class or of the type, or wrap the type with a newtype and declare the instance on the new type. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9178#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9178: improve orphan instance warning -------------------------------------+------------------------------------ Reporter: fphh | Owner: Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): OK with me. Do others like the new error message? It's a user matter not an implementation matter. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9178#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9178: improve orphan instance warning
-------------------------------------+------------------------------------
Reporter: fphh | Owner:
Type: task | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Joachim Breitner

#9178: improve orphan instance warning -------------------------------------+------------------------------------ Reporter: fphh | Owner: Type: task | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by nomeata): * status: patch => closed * resolution: => fixed Comment: Also ok with me. That makes two of us, so I pushed it. Nevertheless: If someone wants to improve it, feel free to do so. Congrats, Heinrich, for your first contribution to GHC, I hope there will be more! :-) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9178#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9178: improve orphan instance warning
-------------------------------------+------------------------------------
Reporter: fphh | Owner:
Type: task | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Joachim Breitner
participants (1)
-
GHC