Proposal: Require OverlappingInstances for the most specific
instance only
Christian Höner zu Siederdissen
choener at tbi.univie.ac.at
Tue Oct 26 18:58:40 EDT 2010
Hi,
can't remember to have been hit by it; but changing would mean that
library maintainers can act more conservatively. Otherwise one needs to
be able to guess if an instance might be overlapped.
The new version wouldn't require that, yes?
Gruss,
Christian
* John Smith <voldermort at hotmail.com> [26.10.2010 21:45]:
> 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.
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20101026/56af3526/attachment.bin
More information about the Glasgow-haskell-users
mailing list