3 ms·
You can do it in Scala which has powerful type support. The problem with other languages is that they lack the support for the higher order types, so the impl
by lonelappde 7y ago
You can do it in Scala which has powerful type support.
The problem with other languages is that they lack the support for the higher order types, so the implementation is dishonest or you have to build up an API (new embedded minilanguage) to express them, which is a lot of work and a distraction.
And, the result tends to be very cluttered with syntax junk, as you can see in Scala and Functional Java.
Which incidentally is why people generally don't use these ideas in Java code. You can use these design ideas in your Java architecture, but not directly express them in your Java code.
- lmm 7y agoOCaml also lacks higher-kinded types. As far as I can tell, anything you can do in OCaml you can also do (perhaps verbosely, though less so in more recent versions) in Java.
- ernst_klim 7y agoOCaml have HKT, it's in the module part of the languiage, it's just verbose. And OCaml's module language is much more powerful than Java, since module language is a dependently typed language. You can't, say, pass a class including a type for another class in java.