SML, Polymorphism and how-do-I-express-typeclasses

I'm inexpert, but very interested in this question. The paper Module Type Classes is probably a good place to look for information on how SML functors can be made to operate akin to Haskell type classes. Of course, that paper suggests language extensions which are, I believe, only being considered in various SML circles. Still, it will help make the relation between type classes and SMl functors clear, and maybe show you how far you can get the latter to provide the features of the former. You might be interested to know that there is at least one implementation of OCaml incorporating modular implicits to realize modular type classes.

When considering the advantages of Haskell type classes over SML functors, you should also keep in mind the advantages the latter has over the former. In general, for every piece of seemingly magic, implicit power provided by Haskell, you pay a price in reduced modularity, enforced arbitrary decisions, and obscured underlying mechanisms. This is not to say that the sweetness of Haskell isn't worth that price, it's just good to remember that it doesn't come for free. For a concise, well articulated explanation of the price of type classes, see http://stackoverflow.com/a/36927542/1187277.

Now, to hazard a guess at your question (please bear in mind my professed inexpertise!): it seems to me that SML programs tend to be much more explicit and much less "clever" than Haskell programs. For example, "Point free" formulations are rarely used and whenever monadic patterns are employed, they use simple binding combinators, not a sugared do notation. Similarly, while groups of related functions operating on different types are abstracted and generalized through functors, the difference is always explicitly indicated in the invocation of the functor. This is more cumbersome, but also more explicit.

/r/sml Thread