[MLton] List comprehensions?

Wesley W. Terpstra wesley at terpstra.ca
Fri Jun 1 12:47:38 PDT 2007


On Jun 1, 2007, at 8:41 PM, Andreas Rossberg wrote:
> From: "Wesley W. Terpstra" <wesley at terpstra.ca>
>>
>> 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.
>
> Among other things, they give you first-class polymorphism and  
> existential types. Lots of interesting and weird things you can do  
> with those... :-)

Ahh. I didn't think of this. That is useful. I've often wanted first- 
class polymorphism, but I didn't think of wrapping it up as a module.  
The pack/unpack syntax isn't particularly elegant, though.

Most of the changes you've made in HaMLet are very beautiful. When/ 
How is SML revised? Will there someday be an SML0x which includes  
views (great syntax!) and the other corrections/improvements?

> Of course, we want to have a unified concept of both. Currently,  
> modules and type classes represent different points in the design  
> space, trading off expressiveness vs convenience differently.

Well, I'm no language designer, but I do appreciate how type  
inference works automagically with type classes. It saves a lot of  
effort. It's clear that functors are more general, though.




More information about the MLton mailing list