-fallow-overlapping-instances Request

Simon Peyton-Jones simonpj@microsoft.com
Tue, 21 May 2002 07:25:49 -0700


I don't understand all the implications of this.
For example, what if we have an instance that
doesn't match C () () now, but may do 'later'
when a type variable has been instantiated.

Overlapping instances are a terrific swamp and while they
are interesting I don't think I'm going to spend a lot of
time on them in the near future, I'm afraid.  But perhaps
someone else can..

Simon

| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]=20
| Sent: 17 May 2002 10:02
| To: GHC List
| Subject: -fallow-overlapping-instances Request
|=20
|=20
| Currently -fallow-overlapping-instances only allows=20
| overlapping instances=20
| if one is a strict subset of the other. This is good=20
| (determinate), but=20
| sometimes you really need two instances that partially=20
| overlap. It would=20
| be nice if this could be disambiguated simply with another instance=20
| declaration. For instance:
|=20
|    	class C a b;=09
|    	instance C a ();
|    	instance C () a;
|    	instance C () ();
|=20
| As you can see, the first two instances partially overlap,=20
| but the third=20
| one disambiguates. I think it would be nice if GHC=20
| -fallow-overlapping-instances allowed this.
|=20
| This would take some of the pain out of overlapping instance=20
| resolution...
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list=20
| Glasgow-haskell-users@haskell.org=20
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-users
|=20