Re: Proposal: Require OverlappingInstances for the most specific instance only

The change should not affect working programs, as it just allows you to
define further places where you say that you want an overlapping
instance.
Gruss,
Christian
* Serge D. Mechveliani
On Tue, Oct 26, 2010 at 09:41:58PM +0200, John Smith wrote:
In the case of overlapping instance declarations, GHC currently requires the less specific instance to be compiled with OverlappingInstances for the more specific instance to be usable. This means that, for example, if you write
type ChessBoard = Array (Int,Int) Piece
there is no way to
instance Show ChessBoard where show board = ...
because Array is already an instance of Show, and was not compiled with OverlappingInstances.
http://hackage.haskell.org/trac/ghc/ticket/3877 requests that OverlappingInstances be required for only the most specific instance declarations, as suggested in the documentation. "Perhaps the rule should instead say that the overlapping instance declaration should be compiled in this way, rather than the overlapped one ... We are interested to receive feedback on these points."
SPJ offered to make this change, if the list users agree. (See comment 6.) Proposed deadline for discussion is 16th November.
I always expected that such programs as above must be valid. On the other hand, I do not understand these possible ways of compilation, these words about "compiled in this way, rather than the overlapped one". Now, as I already have overlapping instances work in my programs, for a long time, it is difficult for me to predict the consequences of the change. Can the team issue the corresponding GHC pre-release for testing, without making a decision for future before the users report their impression?
With kind regards,
----------------- Serge Mechveliani mechvel@botik.ru
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

If it does not effect working programs, than I vote for hackage.haskell.org/trac/ghc/ticket/3877 -- to apply this change for OverlappingInstances. If it does effect, than I would like to have a special pre-release for testing and feeding back from users.
[..] define further places where you say that you want an overlapping instance.
I compile all my (two) projects under MultiParamTypeClasses OverlappingInstances UndecidableInstances FlexibleInstances FlexibleContexts -- I put this to the line of `extensions' in the *.cabal file. And this correlates in a certain way with the way in which GHC complies the library instances. Also I could try to set/skip OverlappingInstances to each module individually -- do not know, so far, whether I really need this. ----------------- Serge Mechveliani mechvel@botik.ru On Tue, Nov 16, 2010 at 05:02:09PM +0100, Christian H?ner zu Siederdissen wrote:
The change should not affect working programs, as it just allows you to define further places where you say that you want an overlapping instance.
Gruss, Christian
* Serge D. Mechveliani
[16.11.2010 16:47]: On Tue, Oct 26, 2010 at 09:41:58PM +0200, John Smith wrote:
In the case of overlapping instance declarations, GHC currently requires the less specific instance to be compiled with OverlappingInstances for the more specific instance to be usable. This means that, for example, if you write
type ChessBoard = Array (Int,Int) Piece
there is no way to
instance Show ChessBoard where show board = ...
because Array is already an instance of Show, and was not compiled with OverlappingInstances.
http://hackage.haskell.org/trac/ghc/ticket/3877 requests that OverlappingInstances be required for only the most specific instance declarations, as suggested in the documentation. "Perhaps the rule should instead say that the overlapping instance declaration should be compiled in this way, rather than the overlapped one ... We are interested to receive feedback on these points."
SPJ offered to make this change, if the list users agree. (See comment 6.) Proposed deadline for discussion is 16th November.
I always expected that such programs as above must be valid. On the other hand, I do not understand these possible ways of compilation, these words about "compiled in this way, rather than the overlapped one". Now, as I already have overlapping instances work in my programs, for a long time, it is difficult for me to predict the consequences of the change. Can the team issue the corresponding GHC pre-release for testing, without making a decision for future before the users report their impression?
participants (2)
-
Christian Höner zu Siederdissen
-
Serge D. Mechveliani