Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains the definition of point schedule _peers_ as well as all kind of utilities to manipulate them.
Synopsis
- data Peer a = Peer {}
- data PeerId
- data Peers a = Peers {
- honestPeers ∷ Map Int a
- adversarialPeers ∷ Map Int a
- adversarialPeers' ∷ Peers a → Map PeerId a
- adversarialPeers'' ∷ Peers a → Map PeerId (Peer a)
- deletePeer ∷ PeerId → Peers a → Peers a
- enumerateAdversaries ∷ [PeerId]
- fromMap ∷ Map PeerId (Peer a) → Peers a
- fromMap' ∷ Map PeerId a → Peers a
- getPeer ∷ PeerId → Peers a → Peer a
- getPeerIds ∷ Peers a → [PeerId]
- honestPeers' ∷ Peers a → Map PeerId a
- honestPeers'' ∷ Peers a → Map PeerId (Peer a)
- isAdversarialPeerId ∷ PeerId → Bool
- isHonestPeerId ∷ PeerId → Bool
- peers' ∷ [a] → [a] → Peers a
- peersFromPeerIdList ∷ [PeerId] → a → Peers a
- peersFromPeerIdList' ∷ [PeerId] → Peers ()
- peersFromPeerList ∷ [Peer a] → Peers a
- peersList ∷ Peers a → [Peer a]
- peersOnlyHonest ∷ a → Peers a
- toMap ∷ Peers a → Map PeerId (Peer a)
- toMap' ∷ Peers a → Map PeerId a
- unionWithKey ∷ (PeerId → a → a → a) → Peers a → Peers a → Peers a
- updatePeer ∷ (a → (a, b)) → PeerId → Peers a → (Peers a, b)
Documentation
General-purpose functor associated with a peer.
Instances
Foldable Peer Source # | |
Defined in Test.Consensus.PointSchedule.Peers fold ∷ Monoid m ⇒ Peer m → m # foldMap ∷ Monoid 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 # elem ∷ Eq a ⇒ a → Peer a → Bool # maximum ∷ Ord a ⇒ Peer a → a # | |
Traversable Peer Source # | |
Functor Peer Source # | |
Show a ⇒ Show (Peer a) Source # | |
Eq a ⇒ Eq (Peer a) Source # | |
Condense a ⇒ Condense (Peer a) Source # | |
CondenseList a ⇒ CondenseList (Peer a) Source # | |
Defined in Test.Consensus.PointSchedule.Peers condenseList ∷ [Peer a] → [String] Source # |
Identifier used to index maps and specify which peer is active during a tick.
Instances
IsString PeerId Source # | |
Defined in Test.Consensus.PointSchedule.Peers fromString ∷ String → PeerId # | |
Generic PeerId Source # | |
Show PeerId Source # | |
Eq PeerId Source # | |
Ord PeerId Source # | |
Hashable PeerId Source # | |
NoThunks PeerId Source # | |
Condense PeerId Source # | |
CondenseList PeerId Source # | |
Defined in Test.Consensus.PointSchedule.Peers condenseList ∷ [PeerId] → [String] Source # | |
type Rep PeerId Source # | |
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 ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "AdversarialPeer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
General-purpose functor for a set of peers.
Peers | |
|
Instances
Foldable Peers Source # | |
Defined in Test.Consensus.PointSchedule.Peers fold ∷ Monoid m ⇒ Peers m → m # foldMap ∷ Monoid 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 # elem ∷ Eq a ⇒ a → Peers a → Bool # maximum ∷ Ord a ⇒ Peers a → a # | |
Functor Peers Source # | |
Show a ⇒ Show (Peers a) Source # | |
Eq a ⇒ Eq (Peers a) Source # | |
adversarialPeers' ∷ Peers a → Map PeerId a Source #
Variant of $sel:adversarialPeers:Peers
that returns a map with PeerId
s as keys.
adversarialPeers'' ∷ Peers a → Map PeerId (Peer a) Source #
Variant of $sel:adversarialPeers:Peers
that returns a map with PeerId
s as keys and
values as Peer
s.
honestPeers' ∷ Peers a → Map PeerId a Source #
Variant of $sel:honestPeers:Peers
that returns a map with PeerId
s as keys.
honestPeers'' ∷ Peers a → Map PeerId (Peer a) Source #
Variant of $sel:honestPeers:Peers
that returns a map with PeerId
s as keys and
values as Peer
s.
isHonestPeerId ∷ PeerId → Bool Source #
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.
peersFromPeerIdList' ∷ [PeerId] → Peers () Source #
Like peersFromPeerIdList
with ()
.
peersOnlyHonest ∷ a → Peers a Source #
A set of peers with only one honest peer carrying the given value.