[MLton] List comprehensions?

Matthew Fluet matthew.fluet at gmail.com
Sun Jun 3 12:10:55 PDT 2007


On 6/1/07, Andreas Rossberg <AndreasRossberg at web.de> wrote:
>
> From: "Matthew Fluet" <fluet at tti-c.org>
> >
> >> What most likely does break defunctorisation, though, is the
> combination
> >> of first-class and higher-order modules.
> >
> > I think just first-class modules (with or without higher-order modules)
> > would compromise defunctorisation.  At the very least, it wouldn't look
> > like a 'classic' defunctorisation.
>
> First-class modules without higher-order ones would imply (or at least I
> meant that to imply) that you could not make functors first-class, i.e.
> you
> only would have first-class structures. Wouldn't defunctorisation still be
> applicable in that case? (Of course, monomorphisation would break.)
>

Agreed, if by "defunctorization" one means just "eliminate functors".
(Which is a more than valid interpretation.)

I guess what I was getting at is a more general interpretation of
"defunctorization", meaning that one eliminates all module-level
constructs by a (simple) translation into core-level constructs.

I don't think that you can turn first-class (first-order) structures
into core-level ML.  As you note elsewhere in the thread, you
immediately get first-class polymorphism and first-class existentials,
so core-ML isn't expressive enough.  I think you could play a
defunctorization like trick to 'tag' each first-class structure to
differentiate the first-class structures that could flow to the same
unpacking.  But, this would certainly require more deep thought.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20070603/dd76f7ad/attachment.html


More information about the MLton mailing list