[bitc-dev] Retrospective: The Issues with Type Classes

Florian Weimer fw at deneb.enyo.de
Wed Apr 11 23:02:14 PDT 2012


* Jeremy Shaw:

> Ugly plumbing is one thing. But the problem here is that you get a
> compile time error that can *only* be fixed by modifying one of those
> libraries so that it no longer defines the conflicting orphan
> instance.

It seems to me that you can run into that only if you rely on an
orphan instance yourself.  As a result, I'm not sure if it qualifies
as a strange action-at-a-distance, although I agree it's pretty bad.
But I still think it's not different in a major way from any other
unnecessary type incompatibility.

> There is no way to hide the conflicting instances when
> importing a module. (That is not an oversight, but a fundamental
> design issue). In an open-source world, modifying the library is
> viable option.

Ahem, this is pretty much specific to Java.  Everybody else frowns
upon dependencies on patched libraries (although it does happen
occasionally).

Source code availability is not a factor, either---I'm pretty sure
patching other people's code to get your job done predates the concept
of source code. 8-)


More information about the bitc-dev mailing list