3 ms·
Except for the tiny fact that you don't get higher-kinded types, which is huge for functional programming.
by innguest 11y ago
Except for the tiny fact that you don't get higher-kinded types, which is huge for functional programming.
- Manishearth 11y agoNote that Rust doesn't have proper HKTs yet, though I believe we'll be getting them eventually.
- seanmcdirmid 11y agoMany statically typed FP languages don't have higher kinded types, or haven't had them for very long. They are kind of new.
- innguest 11y agoSuch as?
- seanmcdirmid 11y agoF# for sure. I'm only sure that Haskell and Scala have them, I'm not sure about SML, OCAML, and the other statically typed FP languages (definitely none of the simple statically typed OO languages have them).
- wyager 11y agoHKTs aren't even remotely necessary for basic functional programming. HKTs are very useful for e.g. typeclasses (used for Monad, Functor, etc. definitions) but you don't need them. Strictly speaking, you don't even need types at all (even though they're great).
- innguest 11y agoThat's totally right which is why I never said anything to the contrary. You're crazy if you do FP without HKT though.
- seanmcdirmid 11y agoHigher-kinded types can definitely be overused. One has to be careful with higher-order anything, since it complicates reasoning about programs. (First-order is simple if you can get away with it)