[MLton] List comprehensions?
Vesa Karvonen
vesa.a.j.k at gmail.com
Fri Jun 1 11:35:43 PDT 2007
On 6/1/07, Wesley W. Terpstra <wesley at terpstra.ca> wrote:
[...]
> I've finally understood what 'first-class' modules are.
>
> Is there any good reason to support these? I can't really think of a
> good use of them except as a way to mimic OOP.
One thing that first-class modules support is first-class
polymorphism. For example, you can have a function that takes a
polymorphic function (as the component of a first-class module) as a
parameter and uses that function at multiple types.
> I'm also still trying to understand what these higher-order functors
> would be good for and what they do.
IMO, a particularly nice aspect of higher-order functors is that they
eliminate the second-class status of functors within the module
language. Without higher-order functors you can only have functors at
the top-level. With higher-order functors, and the ability to have
signatures components in structures, the module language (almost)
subsumes MLton's MLB-language and becomes a powerful namespace/package
language.
-Vesa Karvonen
More information about the MLton
mailing list