consensus-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Consensus.PointSchedule.Peers

Description

This module contains the definition of point schedule _peers_ as well as all kind of utilities to manipulate them.

Synopsis

Documentation

data Peer a Source #

General-purpose functor associated with a peer.

Constructors

Peer 

Fields

Instances

Instances details
Foldable Peer Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

foldMonoid m ⇒ Peer m → m #

foldMapMonoid m ⇒ (a → m) → Peer a → m #

foldMap'Monoid m ⇒ (a → m) → Peer a → m #

foldr ∷ (a → b → b) → b → Peer a → b #

foldr' ∷ (a → b → b) → b → Peer a → b #

foldl ∷ (b → a → b) → b → Peer a → b #

foldl' ∷ (b → a → b) → b → Peer a → b #

foldr1 ∷ (a → a → a) → Peer a → a #

foldl1 ∷ (a → a → a) → Peer a → a #

toListPeer a → [a] #

nullPeer a → Bool #

lengthPeer a → Int #

elemEq a ⇒ a → Peer a → Bool #

maximumOrd a ⇒ Peer a → a #

minimumOrd a ⇒ Peer a → a #

sumNum a ⇒ Peer a → a #

productNum a ⇒ Peer a → a #

Traversable Peer Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

traverseApplicative f ⇒ (a → f b) → Peer a → f (Peer b) #

sequenceAApplicative f ⇒ Peer (f a) → f (Peer a) #

mapMMonad m ⇒ (a → m b) → Peer a → m (Peer b) #

sequenceMonad m ⇒ Peer (m a) → m (Peer a) #

Functor Peer Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

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

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

Show a ⇒ Show (Peer a) Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

showsPrecIntPeer a → ShowS #

showPeer a → String #

showList ∷ [Peer a] → ShowS #

Eq a ⇒ Eq (Peer a) Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

(==)Peer a → Peer a → Bool #

(/=)Peer a → Peer a → Bool #

Condense a ⇒ Condense (Peer a) Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

condensePeer a → String Source #

CondenseList a ⇒ CondenseList (Peer a) Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

condenseList ∷ [Peer a] → [String] Source #

data PeerId Source #

Identifier used to index maps and specify which peer is active during a tick.

Instances

Instances details
IsString PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

fromStringStringPeerId #

Generic PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Associated Types

type Rep PeerIdTypeType #

Methods

fromPeerIdRep PeerId x #

toRep PeerId x → PeerId #

Show PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

showsPrecIntPeerIdShowS #

showPeerIdString #

showList ∷ [PeerId] → ShowS #

Eq PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

(==)PeerIdPeerIdBool #

(/=)PeerIdPeerIdBool #

Ord PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

comparePeerIdPeerIdOrdering #

(<)PeerIdPeerIdBool #

(<=)PeerIdPeerIdBool #

(>)PeerIdPeerIdBool #

(>=)PeerIdPeerIdBool #

maxPeerIdPeerIdPeerId #

minPeerIdPeerIdPeerId #

Hashable PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

hashWithSaltIntPeerIdInt Source #

hashPeerIdInt Source #

NoThunks PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Condense PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

condensePeerIdString Source #

CondenseList PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

condenseList ∷ [PeerId] → [String] Source #

type Rep PeerId Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

type Rep PeerId = D1 ('MetaData "PeerId" "Test.Consensus.PointSchedule.Peers" "ouroboros-consensus-diffusion-0.18.0.0-inplace-consensus-test" 'False) (C1 ('MetaCons "HonestPeer" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "AdversarialPeer" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data Peers a Source #

General-purpose functor for a set of peers.

Constructors

Peers 

Fields

Instances

Instances details
Foldable Peers Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

foldMonoid m ⇒ Peers m → m #

foldMapMonoid m ⇒ (a → m) → Peers a → m #

foldMap'Monoid m ⇒ (a → m) → Peers a → m #

foldr ∷ (a → b → b) → b → Peers a → b #

foldr' ∷ (a → b → b) → b → Peers a → b #

foldl ∷ (b → a → b) → b → Peers a → b #

foldl' ∷ (b → a → b) → b → Peers a → b #

foldr1 ∷ (a → a → a) → Peers a → a #

foldl1 ∷ (a → a → a) → Peers a → a #

toListPeers a → [a] #

nullPeers a → Bool #

lengthPeers a → Int #

elemEq a ⇒ a → Peers a → Bool #

maximumOrd a ⇒ Peers a → a #

minimumOrd a ⇒ Peers a → a #

sumNum a ⇒ Peers a → a #

productNum a ⇒ Peers a → a #

Functor Peers Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

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

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

Show a ⇒ Show (Peers a) Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

showsPrecIntPeers a → ShowS #

showPeers a → String #

showList ∷ [Peers a] → ShowS #

Eq a ⇒ Eq (Peers a) Source # 
Instance details

Defined in Test.Consensus.PointSchedule.Peers

Methods

(==)Peers a → Peers a → Bool #

(/=)Peers a → Peers a → Bool #

adversarialPeers'Peers a → Map PeerId a Source #

Variant of $sel:adversarialPeers:Peers that returns a map with PeerIds as keys.

adversarialPeers''Peers a → Map PeerId (Peer a) Source #

Variant of $sel:adversarialPeers:Peers that returns a map with PeerIds as keys and values as Peers.

fromMap'Map PeerId a → Peers a Source #

Same as fromMap but the map contains unwrapped values.

getPeerPeerIdPeers a → Peer a Source #

getPeerIdsPeers a → [PeerId] Source #

Extract all PeerIds.

honestPeers'Peers a → Map PeerId a Source #

Variant of $sel:honestPeers:Peers that returns a map with PeerIds as keys.

honestPeers''Peers a → Map PeerId (Peer a) Source #

Variant of $sel:honestPeers:Peers that returns a map with PeerIds as keys and values as Peers.

peers' ∷ [a] → [a] → Peers a Source #

Construct Peers from values, adding adversary names based on the default schema.

peersFromPeerIdList ∷ [PeerId] → a → Peers a Source #

Make a Peers structure from a list of peer ids and a default value.

peersFromPeerList ∷ [Peer a] → Peers a Source #

Make a Peers structure from individual Peers.

peersListPeers a → [Peer a] Source #

Convert Peers to a list of Peer.

peersOnlyHonest ∷ a → Peers a Source #

A set of peers with only one honest peer carrying the given value.

toMapPeers a → Map PeerId (Peer a) Source #

toMap'Peers a → Map PeerId a Source #

Same as toMap but the map contains unwrapped values.

unionWithKey ∷ (PeerId → a → a → a) → Peers a → Peers a → Peers a Source #

updatePeer ∷ (a → (a, b)) → PeerIdPeers a → (Peers a, b) Source #