I think that kind-polymorphism in Scala 3 has huge potential for libraries, but like most "higher" concepts, we introduce higher kinds only so we can eliminate them later. If Scala 3 supported functional dependencies between kinded types, we could gain a lot.
-
Show this thread
-
Different-kinded types already fit in the type hierarchy, each under their own kind top-type, and then *everything* is a subtype of `AnyKind`. If we could get a type's "kind top-type" from the type, we could define these functional dependencies to enable elimination later.
1 reply 0 retweets 2 likesShow this thread -
Here's how that might look. Imagine we want to define an interface common to `Show` and `Functor`. def apply[F[T] <: AnyKind, S <: T.kind]: F[S] = ... apply[Show, String] apply[Functor, Show] apply[Functor, String] // error
1 reply 0 retweets 5 likesShow this thread -
This Tweet is unavailable.
Agreed, but Scala already made its decisive but arbitrary choice about partial unification in 2.12...
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.