org.sigilaris.core.application.support.compiletime

Members list

Type members

Classlikes

trait Contains[E, T <: Tuple]

Evidence that element E is contained in tuple T.

Evidence that element E is contained in tuple T.

Type parameters

E

the element type

T

the tuple type

Attributes

Companion
object
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
object Contains

Companion for Contains, providing head and tail derivation instances.

Companion for Contains, providing head and tail derivation instances.

Attributes

Companion
trait
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Contains.type
trait Lookup[S <: Tuple, Name0 <: String, K0, V0]

Evidence for looking up a table by name in a schema.

Evidence for looking up a table by name in a schema.

This typeclass provides compile-time schema lookup, extracting the key/value types and runtime table instance for a named table. This enables cross-module access where a reducer can depend on tables from other modules in the composed schema.

The Lookup instance carries the type information (K0, V0) as type parameters, and the table method returns a StateTable with those exact types preserved, enabling compile-time type-safe access with branded keys.

Type parameters

K0

the key type of the named table

Name

the table name to lookup (literal String type)

S

the schema tuple (tuple of Entry types)

V0

the value type of the named table

Attributes

Example
type Schema = Entry["accounts", Address, Account] *: Entry["balances", Address, BigInt] *: EmptyTuple
// Lookup evidence is automatically summoned
def useTable[F[_], S <: Tuple](tables: Tables[F, S])(using
 lookup: Lookup[S, "balances", Address, BigInt]
): Unit =
 val balancesTable = lookup.table(tables)
 // balancesTable has type StateTable[F] { type Name = "balances"; type K = Address; type V = BigInt }
 val key = balancesTable.brand(Address(123))  // Compiles: K is known to be Address
 balancesTable.get(key)  // Type-safe access
Companion
object
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
object Lookup

Companion for Lookup, providing head and tail derivation instances.

Companion for Lookup, providing head and tail derivation instances.

Attributes

Companion
trait
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Lookup.type
object LookupAuto

Inline derivation helper for Lookup.

Inline derivation helper for Lookup.

Mirrors summonInline to preserve existing behaviour while surfacing a descriptive compile-time error when the evidence cannot be derived.

Attributes

Source
LookupAuto.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LookupAuto.type
trait NameNotInSchema[Name <: String, Schema <: Tuple]

Evidence that a table name does not appear in a schema.

Evidence that a table name does not appear in a schema.

This is used to enforce uniqueness of table names.

Type parameters

Name

the table name to check

Schema

the schema to search

Attributes

Companion
object
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any

Companion for NameNotInSchema, providing derivation instances.

Companion for NameNotInSchema, providing derivation instances.

Attributes

Companion
trait
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait PrefixFreePath[Path <: Tuple, Schema <: Tuple]

Evidence that all table prefixes in Schema are prefix-free when mounted at Path.

Evidence that all table prefixes in Schema are prefix-free when mounted at Path.

This ensures that no table's full key prefix (encodePath(Path) ++ encodeSegment(Name)) is a prefix of another table's prefix, preventing key space collisions.

Type parameters

Path

the mount path tuple

Schema

the schema tuple

Attributes

Companion
object
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any

Companion for PrefixFreePath, providing derivation instances.

Companion for PrefixFreePath, providing derivation instances.

Attributes

Companion
trait
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait Requires[Needs <: Tuple, Schema <: Tuple]

Evidence that all entries in Needs are present in Schema.

Evidence that all entries in Needs are present in Schema.

This typeclass proves at compile-time that a subset relationship holds: every table required by a transaction (Needs) must exist in the module's schema (Schema).

Type parameters

Needs

the required tables (typically from Tx#Reads or Tx#Writes)

Schema

the available tables in the module

Attributes

Companion
object
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
object Requires

Companion for Requires, providing base and inductive derivation instances.

Companion for Requires, providing base and inductive derivation instances.

Attributes

Companion
trait
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Requires.type
object RequiresAuto

Inline derivation helper for Requires.

Inline derivation helper for Requires.

Attributes

Source
RequiresAuto.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait UniqueNames[Schema <: Tuple]

Evidence that all table names in Schema are unique.

Evidence that all table names in Schema are unique.

This ensures no two tables in a module have the same name, preventing prefix collisions.

Type parameters

Schema

the schema tuple

Attributes

Companion
object
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
object UniqueNames

Companion for UniqueNames, providing derivation instances for empty, single, and cons cases.

Companion for UniqueNames, providing derivation instances for empty, single, and cons cases.

Attributes

Companion
trait
Source
Evidence.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Types

type DifferentNames[Name1 <: String, Name2 <: String] = NotGiven[Name1 =:= Name2]

Evidence that two table names are different.

Evidence that two table names are different.

This is a type alias for NotGiven that provides semantic clarity in error messages. While we cannot override NotGiven's @implicitNotFound message, having "DifferentNames" in the error trace makes it clearer what constraint failed.

The actual validation happens through NotGiven, which will show: "But no implicit values were found that match type scala.util.NotGiven[...]"

This is still valuable because:

  1. Error messages show "DifferentNames[Name1, Name2]" in the trace 2. Code is more self-documenting (DifferentNames vs raw NotGiven) 3. Future Scala versions might allow better customization

Type parameters

Name1

the first table name

Name2

the second table name

Attributes

Source
Evidence.scala