Re: [Haskell] A problem with overlapping instances and super-classes

2008-06-10 Thread Ian Lynagh
On Mon, Jun 09, 2008 at 09:21:02AM +0100, Simon Peyton-Jones wrote: This isn't great, but it's not really different than is the case for non-overlapping instances. Suppose module B1 declares 'instance C T', and uses that instance; and module B2 declares a *different* 'instance C T', and

Re: [Haskell] A problem with overlapping instances and super-classes

2008-06-10 Thread Claus Reinke
Yes indeed, this is one of those well-known (ie not at all well known, but folk lore) problems with overlapping instances, at least in programs where different instances can be in scope at different times. I think these examples are subtly different (eg, some trip up Hugs as well, some only

RE: [Haskell] A problem with overlapping instances and super-classes

2008-06-09 Thread Simon Peyton-Jones
Yes indeed, this is one of those well-known (ie not at all well known, but folk lore) problems with overlapping instances, at least in programs where different instances can be in scope at different times. It's discussed (not very clearly) in

Re: [Haskell] A problem with overlapping instances and super-classes

2008-06-09 Thread Claus Reinke
This isn't great, but it's not really different than is the case for non-overlapping instances. Suppose module B1 declares 'instance C T', and uses that instance; and module B2 declares a *different* 'instance C T', and uses that instance; and Main imports B1 and B2, but does not use either

[Haskell] A problem with overlapping instances and super-classes

2008-06-07 Thread Iavor Diatchki
Hello, (you should be able to copy and paste the code in this email into two modules called A and B to try it out) {-# LANGUAGE OverlappingInstances #-} module A where This module, together with module 'B', illustrates a problem in some implementations of overlapping instances and their