TIL Option[_] isn't a higher-kinded type. It's just a type constructor. Higher-kinded types are types that abstract over type constructors (so X[F[_]]). As known as 1st order & higher-order abstraction. But best refer to the latter as "type constructor polymorphism".
-
-
you know you got the HKT when the compiler warns you about it :ppic.twitter.com/K6p85FBp9x
-
Ha! If the compiler (just the REPL, right?) is being clear about this, now, then I should adopt its consistency. :)
End of conversation
New conversation -
-
-
OK, s/Option[_]/Option/ then. But the problem I had with using "Option" is it's also what the companion object (term) is...
-
Yep, Scala cheats away this ambiguity with context-aware syntax. I'm not sure how best to express the intent of Option *as a type* in prose.
- Show replies
New conversation -
-
-
Yeah it seems basically a lost battle, tho I've seen
@larsr_h fight it: the incorrect usages outnumber the correct ones (and they appear even in the published literature). -
I'm not sure I understand. - Int, String, etc are nullary type constructors (*), aka proper types - Option is a unary type constructor (* -> *), as it accepts a proper type as an argument - Higher kinded type is the ability to take * -> * as a type argument, e.g. Functor[F[_]]
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.