ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Ledger.Tables.Basics

Synopsis

Kinds

For convenience' sake, we define these kinds which convey the intended instantiation for the type variables.

type LedgerStateKind = MapKindType 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 = TypeTypeType Source #

Something that holds two types, which intend to represent keys and values.

type StateKind = TypeLedgerStateKind 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

Instances details
(∀ k v. LedgerTableConstraints' l k v ⇒ Monoid (mk k v), LedgerTableConstraints l) ⇒ Monoid (LedgerTables l mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Combinators

Methods

memptyLedgerTables l mk #

mappendLedgerTables l mk → LedgerTables l mk → LedgerTables l mk #

mconcat ∷ [LedgerTables l mk] → LedgerTables l mk #

(∀ k v. LedgerTableConstraints' blk k v ⇒ Semigroup (mk k v), LedgerTableConstraints blk) ⇒ Semigroup (LedgerTables blk mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Combinators

Methods

(<>)LedgerTables blk mk → LedgerTables blk mk → LedgerTables blk mk #

sconcatNonEmpty (LedgerTables blk mk) → LedgerTables blk mk #

stimesIntegral b ⇒ b → LedgerTables blk mk → LedgerTables blk mk #

Generic (LedgerTables blk mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

Associated Types

type Rep (LedgerTables blk mk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type Rep (LedgerTables blk mk) = D1 ('MetaData "LedgerTables" "Ouroboros.Consensus.Ledger.Tables.Basics" "ouroboros-consensus-3.0.1.0-inplace" 'True) (C1 ('MetaCons "LedgerTables" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLedgerTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mk (TxIn blk) (TxOut blk)))))

Methods

fromLedgerTables blk mk → Rep (LedgerTables blk mk) x #

toRep (LedgerTables blk mk) x → LedgerTables blk mk #

Show (mk (TxIn blk) (TxOut blk)) ⇒ Show (LedgerTables blk mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

Methods

showsPrecIntLedgerTables blk mk → ShowS #

showLedgerTables blk mk → String #

showList ∷ [LedgerTables blk mk] → ShowS #

Eq (mk (TxIn blk) (TxOut blk)) ⇒ Eq (LedgerTables blk mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

Methods

(==)LedgerTables blk mk → LedgerTables blk mk → Bool #

(/=)LedgerTables blk mk → LedgerTables blk mk → Bool #

NoThunks (mk (TxIn blk) (TxOut blk)) ⇒ NoThunks (LedgerTables blk mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type Rep (LedgerTables blk mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Basics

type Rep (LedgerTables blk mk) = D1 ('MetaData "LedgerTables" "Ouroboros.Consensus.Ledger.Tables.Basics" "ouroboros-consensus-3.0.1.0-inplace" 'True) (C1 ('MetaCons "LedgerTables" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLedgerTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mk (TxIn blk) (TxOut blk)))))

type family TxIn blk Source #

Each LedgerState instance will have the notion of a TxIn for the tables.

This will change once there is more than one table.

Instances

Instances details
type TxIn (HardForkBlock xs) Source #

Must be the CannonicalTxIn type, but this will probably change in the future to NS WrapTxIn xs. See HasCanonicalTxIn.

Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type TxIn (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

type TxIn (DualBlock m a) = TxIn m

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

Instances details
type TxOut (HardForkBlock xs) Source #

Must be the HardForkTxOut type

Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type TxOut (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

type TxOut (DualBlock m a) = TxOut m