HKTypeLambda

Companion
class

Value members

Concrete methods

def any(n: Int)(using Context): HKTypeLambda
def apply(paramNames: List[TypeName])(paramInfosExp: HKTypeLambda => List[TypeBounds], resultTypeExp: HKTypeLambda => Type)(using Context): HKTypeLambda
def apply(paramNames: List[TypeName], variances: List[Variance])(paramInfosExp: HKTypeLambda => List[TypeBounds], resultTypeExp: HKTypeLambda => Type)(using Context): HKTypeLambda
def boundsFromParams[PI <: Of[TypeName]](params: List[PI], bounds: TypeBounds)(using Context): TypeBounds

Distributes Lambda inside type bounds. Examples:

Distributes Lambda inside type bounds. Examples:

type T[X] = U        becomes    type T = [X] -> U
type T[X] <: U       becomes    type T >: Nothing <: ([X] -> U)
type T[X] >: L <: U  becomes    type T >: ([X] -> L) <: ([X] -> U)

The variances of regular TypeBounds types, as well as of match aliases and of opaque aliases are always determined from the given parameters params. The variances of other type aliases are determined from the given parameters only if one of these parameters carries a + or - variance annotation. Type aliases without variance annotation are treated structurally. That is, their parameter variances are determined by how the parameter(s) appear in the result type.

Examples:

type T[X] >: A // X is invariant type T[X] <: List[X] // X is invariant type T[X] = List[X] // X is covariant (determined structurally) opaque type T[X] = List[X] // X is invariant opaque type T[+X] = List[X] // X is covariant type T[A, B] = A => B // A is contravariant, B is covariant (determined structurally) type T[A, +B] = A => B // A is invariant, B is covariant

override def fromParams[PI <: Of[TypeName]](params: List[PI], resultType: Type)(using Context): Type
Definition Classes

Inherited methods

def apply(paramInfos: List[TypeBounds], resultType: Type)(using Context): HKTypeLambda
Inherited from
LambdaTypeCompanion
def apply(paramInfos: List[TypeBounds])(resultTypeExp: HKTypeLambda => Type)(using Context): HKTypeLambda
Inherited from
LambdaTypeCompanion
def apply(paramNames: List[TypeName], paramInfos: List[TypeBounds], resultType: Type)(using Context): HKTypeLambda
Inherited from
LambdaTypeCompanion
def toPInfo(tp: Type)(using Context): TypeBounds
Inherited from
TypeLambdaCompanion