Re:Exploring ML-Style Modular Programming in Scala
by gmartres on Saturday April 04, 2015 @06:23PM
(#9322432)
Nice post! I think your encoding of functors could be replaced by:
Which looks more like "normal" Scala but still offers the same amount of abstraction.
[ Parent
| on HN ]
Re:Exploring ML-Style Modular Programming in Scala
by yawaramin on Saturday April 04, 2015 @06:37PM
(#9322465)
Thanks!
Yes, you're right that we can use a class here and instantiate an object of the class. I thought I would skip the intermediate step because all I care about is the upcast type, MySet[A], and not the actual derived type.
But it's very much a matter of preference!