From this question: What is a higher kinded type in Scala?, I understand what is higher-order types(also first-order type and proper type).
But there is still a question: What's the relation between generics and "higher-order types"?
I know Java supports generics, which is like the first-order type in Scala.
Which of the following are correct?
first-order type is generics
first-order and higher-order types are both belong to generics
generics just mean first-order type, it's not completegenerics is a common term means we can "abstract" on types, no matter first-order or higher-order
I'd say (1.) is wrong. I'm not sure about (3.) because I'm a bit out of practice concerning Java. But I'd say (4.) is pretty accurate and somewhat similar to (2.).
As far as I know, the term generics refers just to the usage of type parameters. It applies to both first-order and higher-order types or functions.
Offtopic (and somewhat nerdish): Does anyone else see a hidden reference to Wing Commander in (2.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With