ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.TypeFamilyWrappers

Description

Newtypes around type families so that they can be partially applied

Synopsis

Block based

newtype WrapApplyTxErr blk Source #

Constructors

WrapApplyTxErr 

Instances

Instances details
Inject WrapApplyTxErr Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Isomorphic WrapApplyTxErr Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

SerialiseNodeToClient blk (ApplyTxErr blk) ⇒ SerialiseNodeToClient blk (WrapApplyTxErr blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

Show (ApplyTxErr blk) ⇒ Show (WrapApplyTxErr blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

showsPrecIntWrapApplyTxErr blk → ShowS #

showWrapApplyTxErr blk → String #

showList ∷ [WrapApplyTxErr blk] → ShowS #

Eq (ApplyTxErr blk) ⇒ Eq (WrapApplyTxErr blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

(==)WrapApplyTxErr blk → WrapApplyTxErr blk → Bool #

(/=)WrapApplyTxErr blk → WrapApplyTxErr blk → Bool #

newtype WrapGenTxId blk Source #

Constructors

WrapGenTxId 

Fields

Instances

Instances details
Inject WrapGenTxId Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Methods

inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → WrapGenTxId x → WrapGenTxId (HardForkBlock xs) Source #

Isomorphic WrapGenTxId Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

SerialiseNodeToClient blk (GenTxId blk) ⇒ SerialiseNodeToClient blk (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToNode blk (GenTxId blk) ⇒ SerialiseNodeToNode blk (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

Show (GenTxId blk) ⇒ Show (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

showsPrecIntWrapGenTxId blk → ShowS #

showWrapGenTxId blk → String #

showList ∷ [WrapGenTxId blk] → ShowS #

Eq (GenTxId blk) ⇒ Eq (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

(==)WrapGenTxId blk → WrapGenTxId blk → Bool #

(/=)WrapGenTxId blk → WrapGenTxId blk → Bool #

Ord (GenTxId blk) ⇒ Ord (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

compareWrapGenTxId blk → WrapGenTxId blk → Ordering #

(<)WrapGenTxId blk → WrapGenTxId blk → Bool #

(<=)WrapGenTxId blk → WrapGenTxId blk → Bool #

(>)WrapGenTxId blk → WrapGenTxId blk → Bool #

(>=)WrapGenTxId blk → WrapGenTxId blk → Bool #

maxWrapGenTxId blk → WrapGenTxId blk → WrapGenTxId blk #

minWrapGenTxId blk → WrapGenTxId blk → WrapGenTxId blk #

NoThunks (GenTxId blk) ⇒ NoThunks (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Condense (GenTxId blk) ⇒ Condense (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Condense

Methods

condenseWrapGenTxId blk → String Source #

Serialise (GenTxId blk) ⇒ Serialise (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapLedgerUpdate blk Source #

Constructors

WrapLedgerUpdate 

Instances

Instances details
Show (LedgerUpdate blk) ⇒ Show (WrapLedgerUpdate blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Eq (LedgerUpdate blk) ⇒ Eq (WrapLedgerUpdate blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

(==)WrapLedgerUpdate blk → WrapLedgerUpdate blk → Bool #

(/=)WrapLedgerUpdate blk → WrapLedgerUpdate blk → Bool #

newtype WrapLedgerWarning blk Source #

Instances

Instances details
Show (LedgerWarning blk) ⇒ Show (WrapLedgerWarning blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Eq (LedgerWarning blk) ⇒ Eq (WrapLedgerWarning blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapTentativeHeaderState blk Source #

Instances

Instances details
Show (TentativeHeaderState blk) ⇒ Show (WrapTentativeHeaderState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Eq (TentativeHeaderState blk) ⇒ Eq (WrapTentativeHeaderState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Ord (TentativeHeaderState blk) ⇒ Ord (WrapTentativeHeaderState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

NoThunks (TentativeHeaderState blk) ⇒ NoThunks (WrapTentativeHeaderState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapTipInfo blk Source #

Constructors

WrapTipInfo 

Fields

Instances

Instances details
Isomorphic WrapTipInfo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

Show (TipInfo blk) ⇒ Show (WrapTipInfo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

showsPrecIntWrapTipInfo blk → ShowS #

showWrapTipInfo blk → String #

showList ∷ [WrapTipInfo blk] → ShowS #

Eq (TipInfo blk) ⇒ Eq (WrapTipInfo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

(==)WrapTipInfo blk → WrapTipInfo blk → Bool #

(/=)WrapTipInfo blk → WrapTipInfo blk → Bool #

NoThunks (TipInfo blk) ⇒ NoThunks (WrapTipInfo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Serialise (TipInfo blk) ⇒ Serialise (WrapTipInfo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapTxIn blk Source #

Constructors

WrapTxIn 

Fields

Instances

Instances details
Show (TxIn blk) ⇒ Show (WrapTxIn blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

showsPrecIntWrapTxIn blk → ShowS #

showWrapTxIn blk → String #

showList ∷ [WrapTxIn blk] → ShowS #

Eq (TxIn blk) ⇒ Eq (WrapTxIn blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

(==)WrapTxIn blk → WrapTxIn blk → Bool #

(/=)WrapTxIn blk → WrapTxIn blk → Bool #

Ord (TxIn blk) ⇒ Ord (WrapTxIn blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

compareWrapTxIn blk → WrapTxIn blk → Ordering #

(<)WrapTxIn blk → WrapTxIn blk → Bool #

(<=)WrapTxIn blk → WrapTxIn blk → Bool #

(>)WrapTxIn blk → WrapTxIn blk → Bool #

(>=)WrapTxIn blk → WrapTxIn blk → Bool #

maxWrapTxIn blk → WrapTxIn blk → WrapTxIn blk #

minWrapTxIn blk → WrapTxIn blk → WrapTxIn blk #

NoThunks (TxIn blk) ⇒ NoThunks (WrapTxIn blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapTxMeasure blk Source #

Constructors

WrapTxMeasure 

Fields

newtype WrapTxOut blk Source #

Constructors

WrapTxOut 

Fields

Instances

Instances details
Show (TxOut blk) ⇒ Show (WrapTxOut blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

showsPrecIntWrapTxOut blk → ShowS #

showWrapTxOut blk → String #

showList ∷ [WrapTxOut blk] → ShowS #

Eq (TxOut blk) ⇒ Eq (WrapTxOut blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

(==)WrapTxOut blk → WrapTxOut blk → Bool #

(/=)WrapTxOut blk → WrapTxOut blk → Bool #

Ord (TxOut blk) ⇒ Ord (WrapTxOut blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Methods

compareWrapTxOut blk → WrapTxOut blk → Ordering #

(<)WrapTxOut blk → WrapTxOut blk → Bool #

(<=)WrapTxOut blk → WrapTxOut blk → Bool #

(>)WrapTxOut blk → WrapTxOut blk → Bool #

(>=)WrapTxOut blk → WrapTxOut blk → Bool #

maxWrapTxOut blk → WrapTxOut blk → WrapTxOut blk #

minWrapTxOut blk → WrapTxOut blk → WrapTxOut blk #

(All MemPackTxOut xs, Typeable xs) ⇒ MemPack (DefaultHardForkTxOut xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

NoThunks (TxOut blk) ⇒ NoThunks (WrapTxOut blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapValidatedGenTx blk Source #

A data family wrapper for Validated . GenTx

Validated is is data family, so this is an outlier in this module full of type family wrappers. However, the standard functor composition operator f :.: g incurs some type classes instances that are inappropriate when the outer type constructor f is a family and hence non-parametric (eg Eq (f :.: g) requires @Eq1 f)). The bespoke composition WrapValidatedGenTx therefore serves much the same purpose as the other wrappers in this module.

Protocol based

newtype WrapChainDepState blk Source #

Instances

Instances details
Inject WrapChainDepState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary

Isomorphic WrapChainDepState Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

DecodeDisk blk (ChainDepState (BlockProtocol blk)) ⇒ DecodeDisk blk (WrapChainDepState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Serialisation

Methods

decodeDiskCodecConfig blk → ∀ s. Decoder s (WrapChainDepState blk) Source #

EncodeDisk blk (ChainDepState (BlockProtocol blk)) ⇒ EncodeDisk blk (WrapChainDepState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Serialisation

Show (ChainDepState (BlockProtocol blk)) ⇒ Show (WrapChainDepState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Eq (ChainDepState (BlockProtocol blk)) ⇒ Eq (WrapChainDepState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

NoThunks (ChainDepState (BlockProtocol blk)) ⇒ NoThunks (WrapChainDepState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Serialise (ChainDepState (BlockProtocol blk)) ⇒ Serialise (WrapChainDepState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

SerialiseHFC xs ⇒ DecodeDisk (HardForkBlock xs) (HardForkChainDepState xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

SerialiseHFC xs ⇒ EncodeDisk (HardForkBlock xs) (HardForkChainDepState xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

data Ticked (HardForkChainDepState xs ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

newtype Ticked (WrapChainDepState blk ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype WrapIsLeader blk Source #

Constructors

WrapIsLeader 

Instances

Instances details
Isomorphic WrapIsLeader Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

newtype WrapTiebreakerView blk Source #

Instances

Instances details
Show (TiebreakerView (BlockProtocol blk)) ⇒ Show (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Eq (TiebreakerView (BlockProtocol blk)) ⇒ Eq (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Ord (TiebreakerView (BlockProtocol blk)) ⇒ Ord (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

NoThunks (TiebreakerView (BlockProtocol blk)) ⇒ NoThunks (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

ChainOrder (TiebreakerView (BlockProtocol blk)) ⇒ ChainOrder (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

type ChainOrderConfig (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

type ReasonForSwitch (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

Versioning

Type family instances

data family Ticked (st ∷ k) ∷ k Source #

" Ticked " piece of state, either LedgerState or ChainDepState

Ticking refers to the passage of time (the ticking of the clock). When a piece of state is marked as ticked, it means that time-related changes have been applied to the state. There are exactly two methods in the interface that do that: tickChainDepState and applyChainTickLedgerResult.

Also note that a successful forecast forecastFor (ledgerViewForecastAt cfg st) slot must equal protocolLedgerView cfg (applyChainTick cfg slot st). Thus a LedgerView can only be projected from a Ticked state, but cannot itself be ticked.

Some examples of time related changes:

  • Scheduled delegations might have been applied in Byron
  • New leader schedule computed for Shelley
  • Transition from Byron to Shelley activated in the hard fork combinator.
  • Nonces switched out at the start of a new epoch.

Ticked is used mainly in two ways:

  • Ticked (Ext)LedgerState where its kind gets concretized to StateKind -> StateKind
  • Ticked (HeaderState blk) where its kind gets concretized to Type -> Type

Instances

Instances details
Show (Ticked ()) Source # 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecIntTicked () → ShowS #

showTicked () → String #

showList ∷ [Ticked ()] → ShowS #

(NoThunks (TxIn blk), NoThunks (TxOut blk), HasLedgerTables (Ticked LedgerState) blk) ⇒ HasLedgerTables (Ticked ExtLedgerState) blk Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

Methods

projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked ExtLedgerState blk mk → LedgerTables blk mk Source #

withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked ExtLedgerState blk any → LedgerTables blk mk → Ticked ExtLedgerState blk mk Source #

(CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ HasLedgerTables (Ticked LedgerState) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

(Bridge m a, HasLedgerTables (Ticked LedgerState) m) ⇒ HasLedgerTables (Ticked LedgerState) (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (DualBlock m a) mk → LedgerTables (DualBlock m a) mk Source #

withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (DualBlock m a) any → LedgerTables (DualBlock m a) mk → Ticked LedgerState (DualBlock m a) mk Source #

CanHardFork xs ⇒ GetTip (Ticked LedgerState (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

Bridge m a ⇒ GetTip (Ticked LedgerState (DualBlock m a)) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

getTip ∷ ∀ (mk ∷ MapKind). Ticked LedgerState (DualBlock m a) mk → Point (Ticked LedgerState (DualBlock m a)) Source #

IsLedger LedgerState blk ⇒ GetTip (Ticked ExtLedgerState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

Methods

getTip ∷ ∀ (mk ∷ MapKind). Ticked ExtLedgerState blk mk → Point (Ticked ExtLedgerState blk) Source #

NoThunks (Ticked LedgerState (DualBlock m a) mk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Show (Ticked (f a)) ⇒ Show (((TickedTypeType) :.: f) a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecInt → ((TickedTypeType) :.: f) a → ShowS #

show ∷ ((TickedTypeType) :.: f) a → String #

showList ∷ [((TickedTypeType) :.: f) a] → ShowS #

NoThunks (Ticked (f a)) ⇒ NoThunks (((TickedTypeType) :.: f) a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

noThunksContext → ((TickedTypeType) :.: f) a → IO (Maybe ThunkInfo) Source #

wNoThunksContext → ((TickedTypeType) :.: f) a → IO (Maybe ThunkInfo) Source #

showTypeOfProxy (((TickedTypeType) :.: f) a) → String Source #

data Ticked () Source # 
Instance details

Defined in Ouroboros.Consensus.Ticked

data Ticked (HardForkChainDepState xs ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

data Ticked (HeaderState blk ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.HeaderValidation

data Ticked (PBftState c ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

newtype Ticked (WrapChainDepState blk ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

type HeaderHash (Ticked l blk ∷ k2) Source # 
Instance details

Defined in Ouroboros.Consensus.Ticked

type HeaderHash (Ticked l blk ∷ k2) = HeaderHash (l blk)
data Ticked ExtLedgerState (blk ∷ Type) (mk ∷ MapKind) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

data Ticked LedgerState (HardForkBlock xs ∷ Type) (mk ∷ MapKind) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

data Ticked LedgerState (DualBlock m a ∷ Type) (mk ∷ MapKind) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual