You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
Allow kind and variance of type parameters to be inferred based on usage in the type signature or inside the template body instead of having to always be specified fully.
Example:
traitMonad[F[+_]]
traitTraverse[CC[+_]]
// infer the kind [_] for F based on usage in templatetraitCredential[+F, -A] {
def (a: A).check:F[Boolean]
}
// infer the kind [_] and variance + for F & CC based on usage in signaturedefcheckAllCredentials[F:Monad, CC:Traverse, A:Credential[F, *]](
credentials: CC[A]
):F[Boolean] =
credentials.traverse(_.check).map(_.forall(identity))
Motivation:
There's a major syntactic penalty attached both to adding type parameters and to using any variance in type parameters except invariance. e.g. to specify a bifunctor-like data type one has to add and additional of 7 symbols to the type parameter: [+_, +_], for a ZIO-like bifunctor+profunctor type it's 11 symbols - [-_, +_, +_]. This affects libraries that abstract over such types, e.g. BIO typeclass hierarchy.
The text was updated successfully, but these errors were encountered:
Allow kind and variance of type parameters to be inferred based on usage in the type signature or inside the template body instead of having to always be specified fully.
Example:
Motivation:
There's a major syntactic penalty attached both to adding type parameters and to using any variance in type parameters except invariance. e.g. to specify a bifunctor-like data type one has to add and additional of 7 symbols to the type parameter:
[+_, +_]
, for a ZIO-like bifunctor+profunctor type it's 11 symbols -[-_, +_, +_]
. This affects libraries that abstract over such types, e.g. BIO typeclass hierarchy.The text was updated successfully, but these errors were encountered: