[Haskell-cafe] instance Binary UTCTime (Was: Oprhan instances)

Duncan Coutts duncan.coutts at googlemail.com
Thu Dec 3 05:55:34 EST 2009

On Wed, 2009-12-02 at 23:03 +0100, Joachim Breitner wrote:

> Would it be techically possible and feasible to write instance that do
> not actually cause a dependency on the package that defines the class
> resp. the data type? From a distributor point of view, I could live
> quite well with a setup like this:
>  * When the package providing class Foo is compiled, instances for all
> interesting data types in the distribution are defined. This means a lot
> of build-dependencies, but they are not too bad (although annoying).
>  * The generated package does (somehow) not depend on all these data
> packages. Of course, any part of the code that uses these data types,
> especially the class instances, are only usable when the corresponding
> package is also installed. I guess this would need compiler support, to
> not choke on code that uses unknown data types.
>  * Packages needing an instance Foo Bar would just depend on the packges
> providing foo and bar, and the instance will be available and
> functional.
> This idea works symmetric: The instances could also be defined in the
> data type package, with no hard dependency on the package providing the
> class definition.

Aye, I've thought about a model like this before. I think it's worth
considering and working out if it'd be technically feasible.


More information about the Haskell-Cafe mailing list