[Haskell-cafe] deriving instances in GHC 7.*

Alberto G. Corona agocorona at gmail.com
Tue Apr 19 02:02:14 CEST 2011


Well, this is not so general. It seems to be associated to
the inferred contexts in automatically derived instances (generated with the
"deriving" keyword). I will write a clear example as soon as I make sure
what is different between GHC 6 and 7 about this.

2011/4/18 Alberto G. Corona <agocorona at gmail.com>

> By my little experience with GHC 7.*  it seems that this version is
> more "deterministic" when deriving instances. For example
> if there is a general instance declaration such is:
>
> instance C1 x=> C2 x where ....
>
> then   the absence of the C1 instance becomes an error. C1 instance
> becomes a prerequisite for any C2 instance, where in previous
> versions, that was just a overlapping instance in collision with  any
> other less general instance of the C2 class, so it could be overcomed
> with the "OverlappingInstances" flag.
>
> Given that is not possible to hide instances,  this is annoying. I´m
> not saying that this is wrong or even If this is so, because this
> could be a misinterpretation on my side based on the tests I have
> done. Where can I read about the rationale of this change?. General
> Instance derivations rules, as any rule system seem to me naturally
> flexible and with different degrees of generalization rather tan
> rigid.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110419/3a7a6bd0/attachment.htm>


More information about the Haskell-Cafe mailing list