[MLton] ML Workshop, sML Evolution, and CUFP trip report

skaller skaller at users.sourceforge.net
Wed Sep 27 07:28:47 PDT 2006


On Wed, 2006-09-27 at 15:06 +0200, Andreas Rossberg wrote:
> Vesa Karvonen wrote:
> > 
> > Interesting.  Could you (or someone else) summarize the reasons Dave MacQueen
> > gave for not wanting type classes?
> 
> As far as I understood, he dislikes the idea of things being passed 
> around implicitly, like the "dictionaries" associated with type class 
> constraints (which in an ML approach probably would be structures). He 
> considers it a virtue of ML, and part of its simplicity, that no such 
> hidden magic exists, nor is it to be missed.
> 
> Others expressed the view that this was simply a mode of using modules, 
> enabled by extending the power of type inference slightly, in a useful 
> direction.

Gak, I don't understand any of that. I'm implementing typeclasses
in Felix at the moment:

(a) AFAICS there is no record to pass around: it's a whole program
analyser like MLton, the instance functions are known at compile
time and called directly (with no overhead).

(b) there's no type inference: Felix does already
support overloading, so this may be masking the kind of extension
ML would require

So as far as I can see, at least in a whole program analyser,
typeclasses are just syntactic sugar.

i may have missed something (the implementation isn't working yet :)

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net



More information about the MLton mailing list