Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by jules on Friday June 03, 2022 @06:22PM
(#31614416)
Functors and modules are nice but do not have the convenience of traits and type classes. The problem with functors and modules is that you have to manually instantiate the right functors and modules when you want to use some operation. Type classes and traits build the right instantiations for you based on the types.
I want to write `toString (1,true)` not `ToStringPair(ToStringInt)(ToStringBool).toString (1,true)`.
And then the O in OCaml is all about OOP.