On Mon, Apr 9, 2012 at 2:24 PM, Jeremy Shaw <[email protected]> wrote:
> On Mon, Apr 9, 2012 at 12:16 PM, Jonathan S. Shapiro <[email protected]> > wrote: > > On Sun, Apr 8, 2012 at 8:06 PM, Jeremy Shaw <[email protected]> > wrote: > >> > >> On Sun, Apr 8, 2012 at 2:06 PM, Jonathan S. Shapiro <[email protected]> > >> wrote: > >> > >> > The first problem is strictly practical and entirely obvious: two > groups > >> > build libraries, each defines instances of Mumble(char). Years later > >> > their > >> > libraries get linked into a single program, and Kaboom. > >> > >> Right. That is why type-class instances are supposed to be declare > >> either in the module that defines the type or in the module that > >> defines the class. That avoids the problem. > > > > > > Except that (as you note) it doesn't work at scale. You build a > collection > > subsystem. I build a type. A third party wants to instantiate a > collection > > of my type, but lacks source code for either source module. Or simply > > doesn't want to change them for support/maintenance reasons. > > Well, that is easy. They just create an orphan instance in their code. > Except that under the proposed rule about where instances are legally defined, they can't. > > Perhaps. But I suspect (without proof) that the reason these issues > remain > > "minor" is that languages with type classes have yet to be used at scale. > > Possibly. Also, I can't think of any closed source Haskell libraries. > Almost all the code is open-source, BSD3 licensed, and on Cabal.... > And in addition, current Haskell implementations all rely on whole-program compilation. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
