-fallow-overlapping-instances Request

Currently -fallow-overlapping-instances only allows overlapping instances if one is a strict subset of the other. This is good (determinate), but sometimes you really need two instances that partially overlap. It would be nice if this could be disambiguated simply with another instance declaration. For instance: class C a b; instance C a (); instance C () a; instance C () (); As you can see, the first two instances partially overlap, but the third one disambiguates. I think it would be nice if GHC -fallow-overlapping-instances allowed this. This would take some of the pain out of overlapping instance resolution... -- Ashley Yakeley, Seattle WA

Currently -fallow-overlapping-instances only allows overlapping instances if one is a strict subset of the other. This is good (determinate), but sometimes you really need two instances that partially overlap.
From a type-theoretic viewpoint, instance declarations are relations between (sets of) trees (= elements of the respective data types). So one needs representations of such relations with effective decidability of overlapping-ness, most-sepcific-ness and such.
Unsurprisingly, there are representations with nice decidabilities, but they are not very expressive; and on the other hand there are representations with undecidable properties (see -fallow-undecidable-instances) This is an active area of research in the term rewriting/tree automata community, see for example the chapters on "automata and n-ary relations" (as well as "tree set automata") in the TATA book. http://www.grappa.univ-lille3.fr/tata/ Well, at least my impression is that these topics *are* closely related, and *both* should certainly benefit from a closer investigation of their interrelations. (this is what I'll be attempting in one part of my thesis.) best regards, -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
participants (2)
-
Ashley Yakeley
-
Johannes Waldmann