[MLton] extended basis library

Andreas Rossberg rossberg at ps.uni-sb.de
Mon Oct 23 04:42:07 PDT 2006


Vesa Karvonen wrote:
> 
>> Naming convention for functors
>> ----------------------------------------
>> I don't see the point of prefixing functors with "Mk".  It seems
>> redundant, as of course a functor is making a new structure.  Dropping
>> the "Mk" doesn't create a naming conflict, as functors have their own
>> namespace.  Also, there is no conflict in filenames as functors get a
>> different suffix (.fun).
> 
> Well, I think that having separate namespaces for functors and structures
> is a mistake in SML.  In Alice ML functors and structures share the same
> namespace.  So, using the same names for functors and structures makes the
> code slightly more difficult to translate to Alice ML and potentially other
> SML like languages with higher-order functors.

Let me add that we chose the "Mk" convention based on what the Basis 
Library does in a few places on the core level, for example, the 
mkInstream/mkOutstream functions in STREAM_IO and IMPERATIVE_IO.

- Andreas



More information about the MLton mailing list