ouroboros-consensus-0.18.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Ouroboros.Consensus.ChainGenerator.Slot

Synopsis

Counting

data E Source #

Type-level names for the different kinds of slots counted in this library

The data constructors of this type are used in promoted form with -XDataKinds.

Constructors

ActiveSlotE

Active slots must be filled on the honest chain and may be filled on an alternative chain.

EmptySlotE

Empty slots may be filled on the honest chain and must not be filled on an alternative chain.

SlotE

SlotE is the union of ActiveSlotE and EmptySlotE

complementActive ∷ proxy pol → Size base SlotECount base (PreImage pol ActiveSlotE) which → Count base (PreImage pol EmptySlotE) which Source #

Every slot is either active or empty

complementEmpty ∷ proxy pol → Size base SlotECount base (PreImage pol EmptySlotE) which → Count base (PreImage pol ActiveSlotE) which Source #

Every slot is either active or empty

Slot

data S Source #

The activeness of some slot

Instances

Instances details
Arbitrary S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

arbitraryGen S Source #

shrinkS → [S] Source #

Read S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Show S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

showsPrecIntSShowS #

showSString #

showList ∷ [S] → ShowS #

Eq S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

(==)SSBool #

(/=)SSBool #

Ord S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

compareSSOrdering #

(<)SSBool #

(<=)SSBool #

(>)SSBool #

(>=)SSBool #

maxSSS #

minSSS #

Unbox S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Vector Vector S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

MVector MVector S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

basicLengthMVector s SInt Source #

basicUnsafeSliceIntIntMVector s SMVector s S Source #

basicOverlapsMVector s SMVector s SBool Source #

basicUnsafeNewIntST s (MVector s S) Source #

basicInitializeMVector s SST s () Source #

basicUnsafeReplicateIntSST s (MVector s S) Source #

basicUnsafeReadMVector s SIntST s S Source #

basicUnsafeWriteMVector s SIntSST s () Source #

basicClearMVector s SST s () Source #

basicSetMVector s SSST s () Source #

basicUnsafeCopyMVector s SMVector s SST s () Source #

basicUnsafeMoveMVector s SMVector s SST s () Source #

basicUnsafeGrowMVector s SIntST s (MVector s S) Source #

newtype Vector S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

newtype Vector S = V_S (Vector Bool)
newtype MVector s S Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

newtype MVector s S = MV_S (MVector s Bool)

showSSShowS Source #

genSRandomGen g ⇒ Asc → g → (S, g) Source #

Reuse

class POL (pol ∷ Pol) where Source #

Overloaded slot operations for the two polarities

Methods

mkActive ∷ proxy pol → S Source #

Make an active slot

test ∷ proxy pol → SBool Source #

Test whether pol maps the given bit to one

Instances

Instances details
POL 'Inverted Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

mkActive ∷ proxy 'InvertedS Source #

test ∷ proxy 'InvertedSBool Source #

POL 'NotInverted Source # 
Instance details

Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot

Methods

mkActive ∷ proxy 'NotInvertedS Source #

test ∷ proxy 'NotInvertedSBool Source #

data Pol Source #

The polarity of a type

This is used to toggle how functions in this library interact with vectors of S values.

If the polarity is Inverted, then the function will treat all S values as if they were first complemented.

The PreImage type family does the corresponding parameterization of ActiveSlotE and EmptySlotE at the type level.

NOTE: No S value is ever actually complemented because of Inverted, but the functions parameterized by pol will treat them as if they were.

Constructors

Inverted 
NotInverted 

type family PreImage (pol ∷ Pol) (e ∷ E) where ... Source #

PreImage pol e is the complement of e if pol is Inverted and simply e if it's NotInverted