instance visibility

Simon Marlow marlowsd at gmail.com
Sat Sep 27 08:47:22 EDT 2008


kahl at cas.mcmaster.ca wrote:
> Simon Marlow <marlowsd at gmail.com> wrote:
> 
>  >   We must have the property that the imports of a module do not affect 
>  > its API - and the only way to have this property is to avoid orphan 
>  > instances in library APIs.
> 
> To be more precise, I would say that each orphan instance in a library API
> must be the only export of a dedicated visible module,
> and only exported by that module.
> 
> (The only importers of orphan instances are typically Main modules,
>  or ``almost-Main'' modules.)

Why do you believe that?  We seem to have evidence to the contrary, with 
  Control.Monad.Instances being imported by library modules.

Cheers,
	Simon



More information about the Libraries mailing list