io.github.kory33.s2mctest.core.generic.compiletime

Type members

Types

type ContainsDistinctLockedT[T <: Tuple] = T match { case Lock[head] *: tail => ![IncludedInLockedT[tail, head]] && ContainsDistinctLockedT[tail] case EmptyTuple => true }

INTERNAL. A type-level boolean indicating if T, mapped with Lock, contains no duplicate types.

INTERNAL. A type-level boolean indicating if T, mapped with Lock, contains no duplicate types.

Takes O(|T|^2) to compute.

A type-level boolean indicating if T only contains distinct types.

A type-level boolean indicating if T only contains distinct types.

Takes O(|T|^2) to compute.

type IncludedInLockedT[T <: Tuple, A] = T match { case EmptyTuple => false case Lock[A] *: _$1 => true case _$2 *: tail => IncludedInLockedT[tail, A] }

INTERNAL. A type-level boolean indicating if Lock[A] is contained in T.

INTERNAL. A type-level boolean indicating if Lock[A] is contained in T.

Takes O(|T|) to compute.

type IncludedInT[T <: Tuple, A] = IncludedInLockedT[LockTuple[T], A]

A type-level boolean indicating if A appears in T.

A type-level boolean indicating if A appears in T.

Takes O(|T|) to compute.

type Includes[A] = [T <: Tuple] =>> Require[IncludedInT[T, A]]

An alias for Require[IncludedInT[*, A]].

An alias for Require[IncludedInT[*, A]].

Takes O(|T|) to compute, where T is the input tuple.

type IndexOfT[A, T <: Tuple] = IndexOfTInLocked[A, LockTuple[T]]

The least index of A in a tuple T.

The least index of A in a tuple T.

Takes O(|T|) to compute.

type IndexOfTInLocked[A, T <: Tuple] = T match { case Lock[A] *: _$3 => 0 case _$4 *: tail => S[IndexOfTInLocked[A, tail]] }

INTERNAL. The index of A in a tuple T mapped with Lock.

INTERNAL. The index of A in a tuple T mapped with Lock.

Takes O(|T|) to compute.

type Lock[X]

An invariant abstract type with a single type parameter. This can be useful when we wish to match types in an invariant manner.

An invariant abstract type with a single type parameter. This can be useful when we wish to match types in an invariant manner.

See also

IncludedInLockedT for an example usage.

type LockTuple[T <: Tuple] = Map[T, Lock]

INTERNAL. Lock tuple T using Lock constructor.

INTERNAL. Lock tuple T using Lock constructor.

@implicitNotFound("Cannot prove true")
type Require[S <: Boolean] = S =:= true

An implicit evidence that the type S can be reduced to the singleton type true.

An implicit evidence that the type S can be reduced to the singleton type true.

Value members

Concrete methods

transparent inline
def inlineRefineTo[T](inline x: Any): T

Statically cast the argument to type T. Results in a compile-time error if there is not enough information to make the cast safe.

Statically cast the argument to type T. Results in a compile-time error if there is not enough information to make the cast safe.