8
Comments
  • 0
    "But muh simplicity"
  • 1
    @12bitfloat but... but... I couldn’t think of any other downside of F# ;_;
  • 0
    What does higher kinded types mean ?
  • 0
    @dder in short we’re talking about type abstraction here. Higher kinded types are a way to generically abstract over entities taking type consructors.
  • 0
    @100110111 as in new foo(5) returns something different then new foo(“5”)?
  • 1
    @dder I take this as you not being quite familiar with FP concepts? But no, it’s more like the type of types kind, with kind of the same power as generic types in other langs w/o sacrificing type safety, or type integrity. @SortOfTested, help me out here, please. I’m not very good at explaining these things. I could try with functors and monads, but...

    The best I can give is when we have and ordinary type, written as *, we can have a unary type which has kind * -> *, while higher-kinded types have a kind like (* -> *) -> * - and I realise that is NOT a very good explanation, but I can’t come up with a better one right now
  • 0
    @100110111 Ehm, a function returning a function ? And we are talking about the type of the outer outer function ?
    Sortof (pun intended) like a factory ?

    Like:
    GetArtithmetic(“+”) could return a function of type “(int, int)-> int”
    Where as that higher kinded type could be “(string)-> ((int, int)-> int)”
    ?
  • 0
    @dder I might be dumb but aren't higher order types just generic types?
  • 0
    @12bitfloat higher-kinded types are more like generics on generics.

    @dder I think that’s probably the best way to put it. Taking C# as a reference you can easily have List<T>, but you’d need hkt to get List<T<U>>. Kinds are ”types” of types, and a type would be higher-kinded when they are higher-order functions on type level typed using kinds.
Add Comment