Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Script a = Script ( NonEmpty a)
- data NonEmpty a = a :| [a]
- scriptHead :: Script a -> a
- singletonScript :: a -> Script a
- initScript :: MonadSTM m => Script a -> STM m ( TVar m ( Script a))
- stepScript :: MonadSTM m => TVar m ( Script a) -> m a
- stepScriptSTM :: MonadSTM m => TVar m ( Script a) -> STM m a
- initScript' :: MonadSTM m => Script a -> m ( TVar m ( Script a))
- stepScript' :: MonadSTM m => TVar m ( Script a) -> m a
- stepScriptSTM' :: MonadSTM m => TVar m ( Script a) -> STM m a
- arbitraryScriptOf :: Int -> Gen a -> Gen ( Script a)
- prop_shrink_Script :: Fixed ( Script Int ) -> Property
-
data
ScriptDelay
- = NoDelay
- | ShortDelay
- | LongDelay
- type TimedScript a = Script (a, ScriptDelay )
- playTimedScript :: ( MonadAsync m, MonadTimer m) => Tracer m a -> TimedScript a -> m ( TVar m a)
- type PickScript peeraddr = Script ( PickMembers peeraddr)
- data PickMembers peeraddr
- arbitraryPickScript :: Gen ( Set peeraddr) -> Gen ( PickScript peeraddr)
- interpretPickScript :: ( MonadSTM m, Ord peeraddr) => TVar m ( PickScript peeraddr) -> Set peeraddr -> Int -> STM m ( Set peeraddr)
Test scripts
Instances
Non-empty (and non-strict) list type.
Since: base-4.9.0.0
a :| [a] infixr 5 |
Instances
scriptHead :: Script a -> a Source #
singletonScript :: a -> Script a Source #
Timed scripts
data ScriptDelay Source #
Instances
Eq ScriptDelay Source # | |
Defined in Ouroboros.Network.Testing.Data.Script (==) :: ScriptDelay -> ScriptDelay -> Bool Source # (/=) :: ScriptDelay -> ScriptDelay -> Bool Source # |
|
Show ScriptDelay Source # | |
Defined in Ouroboros.Network.Testing.Data.Script |
|
Arbitrary ScriptDelay Source # | |
Defined in Ouroboros.Network.Testing.Data.Script arbitrary :: Gen ScriptDelay Source # shrink :: ScriptDelay -> [ ScriptDelay ] Source # |
type TimedScript a = Script (a, ScriptDelay ) Source #
playTimedScript :: ( MonadAsync m, MonadTimer m) => Tracer m a -> TimedScript a -> m ( TVar m a) Source #
Pick scripts
type PickScript peeraddr = Script ( PickMembers peeraddr) Source #
A pick script is used to interpret the
policyPickKnownPeersForGossip
and
the
policyPickColdPeersToForget
. It selects elements from the given
choices by their index (modulo the number of choices). This representation
was chosen because it allows easy shrinking.
data PickMembers peeraddr Source #
Instances
Eq peeraddr => Eq ( PickMembers peeraddr) Source # | |
Defined in Ouroboros.Network.Testing.Data.Script (==) :: PickMembers peeraddr -> PickMembers peeraddr -> Bool Source # (/=) :: PickMembers peeraddr -> PickMembers peeraddr -> Bool Source # |
|
Show peeraddr => Show ( PickMembers peeraddr) Source # | |
Defined in Ouroboros.Network.Testing.Data.Script |
|
( Arbitrary peeraddr, Ord peeraddr) => Arbitrary ( PickMembers peeraddr) Source # | |
Defined in Ouroboros.Network.Testing.Data.Script arbitrary :: Gen ( PickMembers peeraddr) Source # shrink :: PickMembers peeraddr -> [ PickMembers peeraddr] Source # |
arbitraryPickScript :: Gen ( Set peeraddr) -> Gen ( PickScript peeraddr) Source #