packages with orphaned instances only

Gábor Lehel illissius at
Sun Jan 9 03:18:18 CET 2011

2011/1/9 Henning Thielemann <lemming at>:
> Gábor Lehel schrieb:
>> I wonder if it might be feasible to add some infrastructural support
>> for this, e.g. so-called adapter packages, which get installed
>> automatically when the packages they adapt between are both present?
>> (Or, thinking further, perhaps even automatic importation of adapter
>> modules at the language level?)
> This would be analogous to automatic import of instances at a package level.
> However the adapter package might import other heavyweight packages that
> someone may not want to have.

Yes, that's a good analogy. Basically a way to ensure consistent
instances not just in a single program, but across all of Hackage
(modulo opt-out capabilities).

Presumably the only dependencies for adapter packages would be the two
packages they are adapting between in almost all cases? Either way,
the criterium could be that it gets installed automatically if all of
the dependencies are met. (Though to protect against mischief you'd
need some safeguards like one of the authors of the adaptee packages
having to approve it... or perhaps framing them as 'optional' parts of
existing packages would be better? (Maybe that's already possible with
cabal configurations / optional dependencies?))

If we had adapter modules at the language level with automatic
importation and banned orphan instances outside of them, it would
solve the import-unsafeness of OverlappingInstances, but instead would
present a problem for people who don't want an instance imported not
because they want their own, but simply to prevent accidental usage.
(I.e. the various packages which have certain instances split out into
separate Instances modules.)


Work is punishment for failing to procrastinate effectively.

More information about the Libraries mailing list