Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data E
- complementActive ∷ proxy pol → Size base SlotE → Count base (PreImage pol ActiveSlotE) which → Count base (PreImage pol EmptySlotE) which
- complementEmpty ∷ proxy pol → Size base SlotE → Count base (PreImage pol EmptySlotE) which → Count base (PreImage pol ActiveSlotE) which
- data S
- showS ∷ S → ShowS
- genS ∷ RandomGen g ⇒ Asc → g → (S, g)
- class POL (pol ∷ Pol) where
- data Pol
- type family PreImage (pol ∷ Pol) (e ∷ E) where ...
- inverted ∷ Proxy Inverted
- notInverted ∷ Proxy NotInverted
Counting
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
.
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 |
|
complementActive ∷ proxy pol → Size base SlotE → Count base (PreImage pol ActiveSlotE) which → Count base (PreImage pol EmptySlotE) which Source #
Every slot is either active or empty
complementEmpty ∷ proxy pol → Size base SlotE → Count base (PreImage pol EmptySlotE) which → Count base (PreImage pol ActiveSlotE) which Source #
Every slot is either active or empty
Slot
The activeness of some slot
Instances
Reuse
class POL (pol ∷ Pol) where Source #
Overloaded slot operations for the two polarities
mkActive ∷ proxy pol → S Source #
Make an active slot
test ∷ proxy pol → S → Bool Source #
Test whether pol
maps the given bit to one
Instances
POL 'Inverted Source # | |
POL 'NotInverted Source # | |
Defined in Test.Ouroboros.Consensus.ChainGenerator.Slot |
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.