[Haskell-cafe] Re: What I wish someone had told me...

Stefan Monnier monnier at iro.umontreal.ca
Wed Oct 15 14:45:06 EDT 2008

> The instance selection for an interface is done at run-time and this is
> inherently necessary.  The instance (in a different sense) selection for
> type classes is almost always resolvable statically.  In Haskell 98

In both cases, the dispatch is inherently dynamic, and in both cases,
most dispatches can be resolved at compile-time with sufficient effort.
The actual percentage may be quite different, tho.
Implementation techniques are also fairly different, and the resulting
coding style is also very different, but the two concepts are
fundamentally very close to each other.


More information about the Haskell-Cafe mailing list