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

Ouroboros.Consensus.Ledger.Tables.Diff

Synopsis

Types

data Delta v Source #

Constructors

Insert !v 
Delete 

Instances

Instances details
Functor Delta Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

fmap ∷ (a → b) → Delta a → Delta b #

(<$) ∷ a → Delta b → Delta a #

Semigroup (Delta v) Source #

Right-biased

Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

(<>)Delta v → Delta v → Delta v #

sconcatNonEmpty (Delta v) → Delta v #

stimesIntegral b ⇒ b → Delta v → Delta v #

Generic (Delta v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Associated Types

type Rep (Delta v) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

type Rep (Delta v) = D1 ('MetaData "Delta" "Ouroboros.Consensus.Ledger.Tables.Diff" "ouroboros-consensus-0.26.0.0-inplace" 'False) (C1 ('MetaCons "Insert" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 v)) :+: C1 ('MetaCons "Delete" 'PrefixI 'False) (U1TypeType))

Methods

fromDelta v → Rep (Delta v) x #

toRep (Delta v) x → Delta v #

Show v ⇒ Show (Delta v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

showsPrecIntDelta v → ShowS #

showDelta v → String #

showList ∷ [Delta v] → ShowS #

Eq v ⇒ Eq (Delta v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

(==)Delta v → Delta v → Bool #

(/=)Delta v → Delta v → Bool #

NoThunks v ⇒ NoThunks (Delta v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

type Rep (Delta v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

type Rep (Delta v) = D1 ('MetaData "Delta" "Ouroboros.Consensus.Ledger.Tables.Diff" "ouroboros-consensus-0.26.0.0-inplace" 'False) (C1 ('MetaCons "Insert" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 v)) :+: C1 ('MetaCons "Delete" 'PrefixI 'False) (U1TypeType))

newtype Diff k v Source #

Constructors

Diff (Map k (Delta v)) 

Instances

Instances details
Functor (Diff k) Source #

Custom Functor instance, since Functor (Map k) is actually the Functor instance for a lazy Map.

Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

fmap ∷ (a → b) → Diff k a → Diff k b #

(<$) ∷ a → Diff k b → Diff k a #

Ord k ⇒ Monoid (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

memptyDiff k v #

mappendDiff k v → Diff k v → Diff k v #

mconcat ∷ [Diff k v] → Diff k v #

Ord k ⇒ Semigroup (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

(<>)Diff k v → Diff k v → Diff k v #

sconcatNonEmpty (Diff k v) → Diff k v #

stimesIntegral b ⇒ b → Diff k v → Diff k v #

Generic (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Associated Types

type Rep (Diff k v) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

type Rep (Diff k v) = D1 ('MetaData "Diff" "Ouroboros.Consensus.Ledger.Tables.Diff" "ouroboros-consensus-0.26.0.0-inplace" 'True) (C1 ('MetaCons "Diff" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map k (Delta v)))))

Methods

fromDiff k v → Rep (Diff k v) x #

toRep (Diff k v) x → Diff k v #

(Show k, Show v) ⇒ Show (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

showsPrecIntDiff k v → ShowS #

showDiff k v → String #

showList ∷ [Diff k v] → ShowS #

(Eq k, Eq v) ⇒ Eq (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

Methods

(==)Diff k v → Diff k v → Bool #

(/=)Diff k v → Diff k v → Bool #

(NoThunks k, NoThunks v) ⇒ NoThunks (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

type Rep (Diff k v) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Tables.Diff

type Rep (Diff k v) = D1 ('MetaData "Diff" "Ouroboros.Consensus.Ledger.Tables.Diff" "ouroboros-consensus-0.26.0.0-inplace" 'True) (C1 ('MetaCons "Diff" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map k (Delta v)))))

Conversion

keysSetDiff k v → Set k Source #

Construction

diff ∷ (Ord k, Eq v) ⇒ Map k v → Map k v → Diff k v Source #

Maps

fromMapMap k (Delta v) → Diff k v Source #

fromMapDeletesMap k v → Diff k v Source #

fromMapInsertsMap k v → Diff k v Source #

Set

Lists

fromListOrd k ⇒ [(k, Delta v)] → Diff k v Source #

fromListDeletesOrd k ⇒ [(k, v)] → Diff k v Source #

fromListInsertsOrd k ⇒ [(k, v)] → Diff k v Source #

Query

Size

nullDiff k v → Bool Source #

numDeletesDiff k v → Int Source #

numInsertsDiff k v → Int Source #

sizeDiff k v → Int Source #

Applying diffs

applyDiffOrd k ⇒ Map k v → Diff k v → Map k v Source #

applyDiffForKeysOrd k ⇒ Map k v → Set k → Diff k v → Map k v Source #

Filter

filterWithKeyOnly ∷ (k → Bool) → Diff k v → Diff k v Source #

foldMapDeltaMonoid m ⇒ (Delta v → m) → Diff k v → m Source #

foldMap over the deltas.

traverseDeltaWithKey_Applicative t ⇒ (k → Delta v → t a) → Diff k v → t () Source #

Traversal with keys over the deltas.