| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Ledger.Tables.Basics
Contents
Synopsis
- type LedgerStateKind = MapKind → Type
- type MapKind = Type → Type → Type
- type StateKind = Type → LedgerStateKind
- newtype LedgerTables blk (mk ∷ MapKind) = LedgerTables {
- getLedgerTables ∷ mk (TxIn blk) (TxOut blk)
- type family TxIn blk
- type family TxOut blk
Kinds
For convenience' sake, we define these kinds which convey the intended instantiation for the type variables.
type LedgerStateKind = MapKind → Type Source #
A LedgerStateKind is the kind of any type that takes a single MapKind
parameter. The canonical inhabitant is a ledger state applied to a block type,
for example LedgerState blk.
type MapKind = Type → Type → Type Source #
Something that holds two types, which intend to represent keys and values.
type StateKind = Type → LedgerStateKind Source #
A StateKind is the kind of a ledger state *before* it receives
its block argument.
The four inhabitants in this codebase are [Ticked] [Ext]LedgerState.
Ledger tables
newtype LedgerTables blk (mk ∷ MapKind) Source #
The Ledger Tables represent the portion of the data on disk that has been pulled from disk and attached to the in-memory Ledger State or that will eventually be written to disk.
With UTxO-HD and the split of the Ledger ledger state into the in-memory
part and the on-disk part, this splitting was reflected in the new type
parameter added to the (Consensus)
LedgerState, to which we refer as "the
MapKind" or mk.
Every LedgerState (or LedgerState-like
type, such as the ExtLedgerState) is
associated with a LedgerTables and they both share the mk. They both are
of kind LedgerStateKind. LedgerTables is just a way to refer only to a
partial view of the on-disk data without having the rest of the in-memory
LedgerState in scope.
The mk can be instantiated to anything that is map-like, i.e. that expects
two type parameters, the key and the value.
Constructors
| LedgerTables | |
Fields
| |
Instances
Each LedgerState instance will have the notion of a TxIn for the tables.
This will change once there is more than one table.
Instances
| type TxIn (HardForkBlock xs) Source # | Must be the |
| type TxIn (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
type family TxOut blk Source #
Each LedgerState instance will have the notion of a TxOut for the
tables.
This will change once there is more than one table.
Instances
| type TxOut (HardForkBlock xs) Source # | Must be the |
| type TxOut (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |