On Sun, Nov 29, 2009 at 8:42 AM, pbrowne <[email protected]> wrote:
> Question 3) Instances are not named so can they be imported?

Whenever you import a module, you automatically import all of its
instances as well. In fact, there is no way to *not* include instances
when importing a module.

Furthermore, any instances you import are automatically re-exported by
your own module. The upshot is that importing any module will
automatically include any instances defined in the transitive closure
of module dependencies, and there's nothing you can do to stop it.

(Yes, this is sometimes very irritating, though I appreciate some of
the motivations behind it. It's also one of the reasons why “orphan
instances” are discouraged.)


Stuart
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to