[GHC] #8141: Liberalising IncoherentInstances

#8141: Liberalising IncoherentInstances ------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- As [http://www.haskell.org/pipermail/glasgow-haskell- users/2013-July/022651.html|SPJ argued], -XIncoherentInstances could be even more liberal. This ticket is to give the proposal a number; I am currently preparing a patch for this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 nomeata): I wanted to write: “As [http://www.haskell.org/pipermail/glasgow-haskell- users/2013-July/022651.html SPJ argued]” (stupid Wiki syntax guessing...) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 nomeata): Patches ready at * https://github.com/nomeata/ghc/compare/liberalisingIncoherent and * https://github.com/nomeata/ghc-testsuite/compare/liberalisingIncoherent -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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): Thanks. But shouldn't there be some carefully-written text (along the lines of my email) in the overlapping-instances section of the manual? And likewise, the comments in `Note [Incoherent Instances]` currently cover only the narrow question of your email, not the broader issue of my original post. Could you combine the two. (Also the Note needs a cross- ref from `BasicTypes`.) Ta Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 nomeata): Thanks for the review; I have reworked the documentation and the notes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 nomeata): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 thoughtpolice): This looks good to me. Thanks for the doc updates - I'll get to this shortly... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances
-------------------------------------+------------------------------------
Reporter: nomeata | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
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 Austin Seipp

#8141: Liberalising IncoherentInstances
-------------------------------------+------------------------------------
Reporter: nomeata | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
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 Austin Seipp

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged with a release note blurb. Thank you Joachim! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 simonpj): * status: closed => new * resolution: fixed => Comment: I can't quite see from the diffs, but I would like the user manual to pretty much give the specification in my email: {{{ More precisely, when trying to find an instance matching a target constraint (C tys), a) Find all instances matching (C tys); these are the candidates b) Eliminate any candidate X for which another candidate Y is strictly more specific (ie Y is a substitution instance of X), if either X or Y was complied with -XOverlappingInstances c) Check that any non-candidate instances that *unify* with (C tys) were compiled with -XIncoherentInstances d) If only one candidate remains, pick it. Otherwise if all remaining candidates were compiled with -XInccoherentInstances, pick an arbitrary candidate }}} I don't think it yet does. I'll take a look. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 nomeata): I couldn’t quite fit it in the existing docs without adding various redundancies or rewriting it completely. I tried to make sure that all the information from your quote was present, although possibly in a different shape. Maybe I should have edited it more boldly; if you want me to try again I can do that (next week, after my holidays). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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): Don't worry; I've done it. Will push on Monday -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 simonpj): * status: new => closed * resolution: => fixed Comment: Documentation done. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8141: Liberalising IncoherentInstances -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 carter): for posterity, a working link to the associated cafe discussion is http://www.haskell.org/pipermail/glasgow-haskell- users/2013-July/024131.html (the old links didn't work) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8141#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC