ouroboros-consensus-0.26.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Fragment.Validated

Contents

Description

Intended for qualified import

import Ouroboros.Consensus.Fragment.Validated (ValidatedFragment)
import qualified Ouroboros.Consensus.Fragment.Validated as VF
Synopsis

Documentation

data ValidatedFragment b l where Source #

Validated chain fragment along with the ledger state after validation

INVARIANT:

AF.headPoint validatedFragment == ledgerTipPoint validatedLedger

The invariant is only checked on construction, maintaining it afterwards is up to the user.

Bundled Patterns

pattern ValidatedFragment ∷ ∀ l b (mk ∷ MapKind). (GetTip l, HasHeader b, HeaderHash b ~ HeaderHash l, HasCallStack) ⇒ AnchoredFragment b → l mk → ValidatedFragment b (l mk) 

Instances

Instances details
Functor (ValidatedFragment b) Source # 
Instance details

Defined in Ouroboros.Consensus.Fragment.Validated

Methods

fmap ∷ (a → b0) → ValidatedFragment b a → ValidatedFragment b b0 #

(<$) ∷ a → ValidatedFragment b b0 → ValidatedFragment b a #

Foldable (ValidatedFragment b) Source # 
Instance details

Defined in Ouroboros.Consensus.Fragment.Validated

Methods

foldMonoid m ⇒ ValidatedFragment b m → m #

foldMapMonoid m ⇒ (a → m) → ValidatedFragment b a → m #

foldMap'Monoid m ⇒ (a → m) → ValidatedFragment b a → m #

foldr ∷ (a → b0 → b0) → b0 → ValidatedFragment b a → b0 #

foldr' ∷ (a → b0 → b0) → b0 → ValidatedFragment b a → b0 #

foldl ∷ (b0 → a → b0) → b0 → ValidatedFragment b a → b0 #

foldl' ∷ (b0 → a → b0) → b0 → ValidatedFragment b a → b0 #

foldr1 ∷ (a → a → a) → ValidatedFragment b a → a #

foldl1 ∷ (a → a → a) → ValidatedFragment b a → a #

toListValidatedFragment b a → [a] #

nullValidatedFragment b a → Bool #

lengthValidatedFragment b a → Int #

elemEq a ⇒ a → ValidatedFragment b a → Bool #

maximumOrd a ⇒ ValidatedFragment b a → a #

minimumOrd a ⇒ ValidatedFragment b a → a #

sumNum a ⇒ ValidatedFragment b a → a #

productNum a ⇒ ValidatedFragment b a → a #

Traversable (ValidatedFragment b) Source # 
Instance details

Defined in Ouroboros.Consensus.Fragment.Validated

Methods

traverseApplicative f ⇒ (a → f b0) → ValidatedFragment b a → f (ValidatedFragment b b0) #

sequenceAApplicative f ⇒ ValidatedFragment b (f a) → f (ValidatedFragment b a) #

mapMMonad m ⇒ (a → m b0) → ValidatedFragment b a → m (ValidatedFragment b b0) #

sequenceMonad m ⇒ ValidatedFragment b (m a) → m (ValidatedFragment b a) #

validatedLedgerValidatedFragment b l → l Source #

Ledger after validation

Monadic

newM ∷ (MonadSTM m, GetTipSTM m l, HasHeader b, HeaderHash b ~ HeaderHash l, HasCallStack) ⇒ AnchoredFragment b → l → m (ValidatedFragment b l) Source #

Constructor for ValidatedFragment that checks the invariant