compileTime

io.github.iltotore.iron.compileTime$

Methods and types to ease compile-time operations.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Types

type %[A, B] = NumOp[A, B, %, %, %, %]

Polymorphic modulo.

Polymorphic modulo.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type *[A, B] = NumOp[A, B, *, *, *, *]

Polymorphic multiplication.

Polymorphic multiplication.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type +[A, B] = (A, B) match { case (String, _$19) => A + ToString[B] case (_$20, String) => ToString[A] + B case Any => NumOp[A, B, +, +, +, +] }

Polymorphic addition.

Polymorphic addition.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type -[A, B] = NumOp[A, B, -, -, -, -]

Polymorphic strict subtraction.

Polymorphic strict subtraction.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type /[A, B] = NumOp[A, B, /, /, /, /]

Polymorphic division.

Polymorphic division.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type <[A, B] = NumOp[A, B, <, <, <, <]

Polymorphic strict inferiority.

Polymorphic strict inferiority.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type <=[A, B] = NumOp[A, B, <=, <=, <=, <=]

Polymorphic non-strict inferiority.

Polymorphic non-strict inferiority.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type >[A, B] = NumOp[A, B, >, >, >, >]

Polymorphic strict superiority.

Polymorphic strict superiority.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type >=[A, B] = NumOp[A, B, >=, >=, >=, >=]

Polymorphic non-strict superiority.

Polymorphic non-strict superiority.

Attributes

A

the left member of this operation.

B

the right member of this operation.

type Compatible[A, B] = A match { case Int => B match { case Int => (A, B) case Long => (ToLong[A], B) case Float => (ToFloat[A], B) case Double => (ToDouble[A], B) } case Long => B match { case Int => (A, ToLong[B]) case Long => (A, B) case Float => (ToFloat[A], B) case Double => (ToDouble[A], B) } case Float => B match { case Int => (A, ToFloat[A]) case Long => (A, ToFloat[A]) case Float => (A, B) case Double => (ToDouble[A], B) } case Double => B match { case Int => (A, ToDouble[A]) case Long => (A, ToDouble[A]) case Float => (A, ToDouble[A]) case Double => (A, B) } }

Convert the two given numerical types to the least common parent.

Convert the two given numerical types to the least common parent.

Attributes

A

the first type to convert.

B

the second type to convert.

type NumConstant = Int | Long | Float | Double
type NumOp[A, B, IntOp[_ <: Int, _ <: Int], LongOp[_ <: Long, _ <: Long], FloatOp[_ <: Float, _ <: Float], DoubleOp[_ <: Double, _ <: Double]] = Compatible[A, B] match { case (Int, Int) => IntOp[A, B] case (Long, Long) => LongOp[A, B] case (Float, Float) => FloatOp[A, B] case (Double, Double) => DoubleOp[A, B] }

Polymorphic numerical binary operator. Takes the right implementation according to the least common type of A and B.

Polymorphic numerical binary operator. Takes the right implementation according to the least common type of A and B.

Attributes

A

the left member of this operation.

B

the right member of this operation.

DoubleOp

the operation to apply if both types can be converted to Double.

FloatOp

the operation to apply if both types can be converted to Float.

IntOp

the operation to apply if both types can be converted to Int.

LongOp

the operation to apply if both types can be converted to Long.

type ToDouble[A <: NumConstant] = A match { case Int => ToDouble[A] case Long => ToDouble[A] case Float => ToDouble[A] case Double => A & Double }

Polymorphic ToDouble.

Polymorphic ToDouble.

Attributes

A

the constant type to cast.

type ToLong[A <: NumConstant] = A match { case Double => ToLong[A] case Float => ToLong[A] case Int => ToLong[A] case Long => A & Long }

Polymorphic ToLong.

Polymorphic ToLong.

Attributes

A

the constant type to cast.

type Zero[A] = A match { case Int => 0 case Long => 0L case Float => 0.0f case Double => 0.0d }

The zero number of the given type.

The zero number of the given type.

Attributes

A

the numerical primitive type.

Value members

Concrete methods

def applyConstraint[A, C, Impl <: Constraint[A, C]](expr: Expr[A], constraintExpr: Expr[Impl])(using Quotes): Expr[Boolean]
transparent inline def doubleValue[A <: NumConstant]: Double

Get the Double value of the given type.

Get the Double value of the given type.

Attributes

A

the type to convert to Double.

Returns:

the String representation of the given type. Equivalent to constValue[ToDouble[A]].

transparent inline def longValue[A <: NumConstant]: Long

Get the Long value of the given type.

Get the Long value of the given type.

Attributes

A

the type to convert to Long.

Returns:

the Long representation of the given type. Equivalent to constValue[ToLong[A]].

transparent inline def stringValue[A]: String

Get the String value of the given type.

Get the String value of the given type.

Attributes

A

the type to convert to String.

Returns:

the String representation of the given type. Equivalent to constValue[ToString[A]].