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

John Smith voldermort at hotmail.com
Wed Oct 27 03:50:56 EDT 2010


The ticket has been updated with the new deadline. (My message to glasgow-haskell-users at haskell.org should have gone to 
libraries as well, perhaps gmane's NNTP interface doen't like cross-posting?)

On 27/10/2010 09:46, Simon Peyton-Jones wrote:
> Libraries folk: see John's proposal below, which would affect libraries.
>
> John: I suggest a longer deadline, say end Nov.  Unlike libraries, this one has global implications.
>
> Simon
>
> -----Original Message-----
> From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-users-bounces at haskell.org] On Behalf Of John Smith
> Sent: 26 October 2010 20:42
> To: glasgow-haskell-users at haskell.org
> Subject: Proposal: Require OverlappingInstances for the most specific instance only
>
> 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.



More information about the Libraries mailing list