3 ms·
Tangentially related questions to generics, anyone think java will ever get higher kinded types? It would be super useful to have a better way of expressing hig
by raiflip 7y ago
Tangentially related questions to generics, anyone think java will ever get higher kinded types? It would be super useful to have a better way of expressing higher level abstractions.
- adimitrov 7y agoJava will not get HKTs in yours and my lifetime. What might get HKTs is Kotlin. There's a proposal brought forward by the Arrow people that has attracted a lot of attention. https://github.com/Kotlin/KEEP/pull/87 https://github.com/Kotlin/KEEP/pull/87 If if that does not succeed, the Arrow folks are working on a meta compiler (think template Haskell but with IDE support) that should get you HKTs and union types. https://github.com/arrow-kt/arrow-meta https://github.com/arrow-kt/arrow-meta Regardless, something quite close to HKTs is available today via type level defunctionalisation. Just look at the Arrow docs
- raiflip 7y agoYeah Arrow is pretty great. There's a similar work around for HKT in java: https://github.com/highj/highj https://github.com/highj/highj. I would much rather some native syntax like K<T> where K is some generic though.