Jon Fairbairn wrote:
> I go for A, though I'd say that type declarations are part
> of the definitions and the definitions in a module
> obviously are of names in that module.
Yes, I agree the declarations are part of the definitions.
> > Btw, why would one declare the type of a function defined outside the
> > current module? For documentation only? I would just use a comment if
> > that's the case.
>
> You might want to restrict the type of an imported function
> to something less polymorphic. But it seems to me that the
> logical place for such things is in the import list, since
> this is effectively defining the environment for the module.
I agree that this type of thing should go in the import list. I'm not
sure we should allow one to make imported functions less polymorphic;
maybe that should require a re-definition. I do think that the more
paranoid among us might want to guard against type changes in other
modules by declaring the type of imported functions, resulting in a type
mismatch if the other module changes.
Matt