org.sigilaris.core.application.support.compiletime.Lookup
See theLookup companion object
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
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article