TypeParam

zio.blocks.typeid.TypeParam
See theTypeParam companion object
final case class TypeParam(name: String, index: Int, variance: Variance = ..., bounds: TypeBounds = ..., kind: Kind = ...)

Represents a type parameter specification.

A TypeParam captures the essential information about a type parameter, including its name, position, variance, bounds, and kind.

For example, for Either[+A, +B]:

  • A would be TypeParam("A", 0, Variance.Covariant)
  • B would be TypeParam("B", 1, Variance.Covariant)

For Functor[F[_]]:

  • F would be TypeParam("F", 0, Variance.Invariant, TypeBounds.Unbounded, Kind.Star1)

Value parameters

bounds

The type bounds (>: Lower *, etc.)

index

The position in the type parameter list (0-indexed)

name

The name of the type parameter

variance

The variance annotation (+, -, or none)

Attributes

Companion
object
Source
TypeParam.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def hasLowerBound: Boolean

Returns true if this type parameter has a lower bound.

Returns true if this type parameter has a lower bound.

Attributes

Source
TypeParam.scala
def hasUpperBound: Boolean

Returns true if this type parameter has an upper bound.

Returns true if this type parameter has an upper bound.

Attributes

Source
TypeParam.scala
def isContravariant: Boolean

Returns true if this type parameter is contravariant (-).

Returns true if this type parameter is contravariant (-).

Attributes

Source
TypeParam.scala
def isCovariant: Boolean

Returns true if this type parameter is covariant (+).

Returns true if this type parameter is covariant (+).

Attributes

Source
TypeParam.scala
def isInvariant: Boolean

Returns true if this type parameter is invariant.

Returns true if this type parameter is invariant.

Attributes

Source
TypeParam.scala
def isProperType: Boolean

Returns true if this type parameter is a proper type (kind *).

Returns true if this type parameter is a proper type (kind *).

Attributes

Source
TypeParam.scala
def isTypeConstructor: Boolean

Returns true if this type parameter is a type constructor (kind * -> * etc.).

Returns true if this type parameter is a type constructor (kind * -> * etc.).

Attributes

Source
TypeParam.scala
override def toString: String

Returns a string representation of this type parameter.

Returns a string representation of this type parameter.

Attributes

Definition Classes
Any
Source
TypeParam.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala