Export lists in modules
Malcolm.Wallace at cs.york.ac.uk
Wed Feb 22 07:07:44 EST 2006
John Meacham <john at repetae.net> wrote:
> Malcolm Wallace wrote:
> > There is also the issue that we might adopt the proposal to allow
> > (and perhaps eventually, to require) type signatures on export
> > lists.
> All I have to say is "please, no" to the requiring part that is.
I don't seriously propose for haskell-prime that signatures should be
required on exports. Just permitting them would be a large and useful
step up already. But the argument about whether to specify a module
interface completely and explicitly in the source file might arise again
in the next standardisation process, where I can see the balance might
tip more in favour of compulsion.
> I totally think type signatures in export lists should be allowed
> optionally with the exact same meaning as if they were specified at
> the top level within the module.
At the moment, only one type signature is permitted per entity (except
for FFI foreign exports, where the exported signature may be more
specific than the definitional signature). My proposal is that the
normal export list can have signatures /in addition to/ the definitional
signature, but that if there are thus two signatures for an entity, they
must be identical. This is to prevent the case where one modifies the
definition of the function, making it more general, but forgets to
modify the corresponding export.
More information about the Haskell-prime