halotukozak.commons

Members list

Type members

Classlikes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait TailRecTraversable[F[_]]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed infix trait containsOnly[-Tup <: Tuple, +T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object containsOnly

Types

type HasDuplicates[Tup <: Tuple] = Tup match { case EmptyTuple => false case h *: t => Contains[t, h] || HasDuplicates[t] }
type Indices[Tup <: Tuple] = Tup match { case EmptyTuple => EmptyTuple case h *: t => 0 *: IndicesAux[t, 1] }
type IndicesAux[Tup <: Tuple, N <: Int] = Tup match { case EmptyTuple => EmptyTuple case h *: t => N *: IndicesAux[t, S[N]] }
type Of[T] = [Tup <: Tuple] =>> containsOnly[Tup, T]

Value members

Concrete methods

inline def deepRecursive[T](inline body: T): T
def deepRecursiveImpl[T](body: Expr[T], memoized: Boolean)(using Quotes, Type[T]): Expr[T]
inline def deepRecursiveMemoized[T](inline body: T): T
def realCons(x: Any, tup: Tuple): x.type *: tup.type

Extensions

Extensions

extension (companion: Expr.type)
def ofRefinedTuple(exprs: List[Expr[_]])(using Quotes): Expr[Tuple]

Build an Expr[Tuple] from a List[Expr[?]], keeping the precise h0 *: h1 *: … *: EmptyTuple element type.

Build an Expr[Tuple] from a List[Expr[?]], keeping the precise h0 *: h1 *: … *: EmptyTuple element type.

The emitted term is a single flat Tuple.fromArray(Array(…)).asInstanceOf[…], not a nested h0 *: (h1 *: (…)). A nested chain re-ascribes the whole remaining tuple type at every cons, so it expands to O(n²) tree size wherever it lands at an inline use site — measurably the bulk of the inlining phase in derivation-heavy downstreams (mirror elems, per-element annotation flags, …). The flat form is O(n).

Attributes

extension (tup: Tuple)
def foreach(f: [t] => t => Unit): Unit
inline def hasDuplicates: HasDuplicates[tup.type]
def indices: Indices[tup.type]
def mapAs[T](using containsOnly[tup.type, T])[F[_ <: T]](f: [t <: T] => t => F[t]): Map[tup.type, [X] =>> F[X & T]]
def to[T](using containsOnly[tup.type, T])[C](factory: Factory[T, C]): C
def toArrayOf[T](using containsOnly[tup.type, T])(using ClassTag[T]): Array[T]