cardano-slotting-0.2.0.1: Key slotting types for cardano libraries
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Slotting.Slot

Synopsis

Documentation

newtype SlotNo Source #

The 0-based index for the Ourboros time slot.

Constructors

SlotNo 

Fields

Instances

Instances details
FromJSON SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Bounded SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Enum SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Generic SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep SlotNoTypeType #

Methods

fromSlotNoRep SlotNo x #

toRep SlotNo x → SlotNo #

Num SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(+)SlotNoSlotNoSlotNo #

(-)SlotNoSlotNoSlotNo #

(*)SlotNoSlotNoSlotNo #

negateSlotNoSlotNo #

absSlotNoSlotNo #

signumSlotNoSlotNo #

fromIntegerIntegerSlotNo #

Show SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

showsPrecIntSlotNoShowS #

showSlotNoString #

showList ∷ [SlotNo] → ShowS #

FromCBOR SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBORSlotNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotNo] → Size Source #

NFData SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfSlotNo → () #

Eq SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(==)SlotNoSlotNoBool #

(/=)SlotNoSlotNoBool #

Ord SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

compareSlotNoSlotNoOrdering #

(<)SlotNoSlotNoBool #

(<=)SlotNoSlotNoBool #

(>)SlotNoSlotNoBool #

(>=)SlotNoSlotNoBool #

maxSlotNoSlotNoSlotNo #

minSlotNoSlotNoSlotNo #

NoThunks SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Serialise SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep SlotNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep SlotNo = D1 ('MetaData "SlotNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.1-inplace" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data WithOrigin t Source #

Constructors

Origin 
At !t 

Instances

Instances details
Foldable WithOrigin Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

foldMonoid m ⇒ WithOrigin m → m #

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

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

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

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

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

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

foldr1 ∷ (a → a → a) → WithOrigin a → a #

foldl1 ∷ (a → a → a) → WithOrigin a → a #

toListWithOrigin a → [a] #

nullWithOrigin a → Bool #

lengthWithOrigin a → Int #

elemEq a ⇒ a → WithOrigin a → Bool #

maximumOrd a ⇒ WithOrigin a → a #

minimumOrd a ⇒ WithOrigin a → a #

sumNum a ⇒ WithOrigin a → a #

productNum a ⇒ WithOrigin a → a #

Traversable WithOrigin Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

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

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

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

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

Functor WithOrigin Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

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

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

FromJSON a ⇒ FromJSON (WithOrigin a) Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON a ⇒ ToJSON (WithOrigin a) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Bounded t ⇒ Bounded (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Generic (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep (WithOrigin t) ∷ TypeType #

Methods

fromWithOrigin t → Rep (WithOrigin t) x #

toRep (WithOrigin t) x → WithOrigin t #

Show t ⇒ Show (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

showsPrecIntWithOrigin t → ShowS #

showWithOrigin t → String #

showList ∷ [WithOrigin t] → ShowS #

(Serialise t, Typeable t) ⇒ FromCBOR (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

(Serialise t, Typeable t) ⇒ ToCBOR (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBORWithOrigin t → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (WithOrigin t) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [WithOrigin t] → Size Source #

NFData a ⇒ NFData (WithOrigin a) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfWithOrigin a → () #

Eq t ⇒ Eq (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(==)WithOrigin t → WithOrigin t → Bool #

(/=)WithOrigin t → WithOrigin t → Bool #

Ord t ⇒ Ord (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

compareWithOrigin t → WithOrigin t → Ordering #

(<)WithOrigin t → WithOrigin t → Bool #

(<=)WithOrigin t → WithOrigin t → Bool #

(>)WithOrigin t → WithOrigin t → Bool #

(>=)WithOrigin t → WithOrigin t → Bool #

maxWithOrigin t → WithOrigin t → WithOrigin t #

minWithOrigin t → WithOrigin t → WithOrigin t #

NoThunks t ⇒ NoThunks (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

Serialise t ⇒ Serialise (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep (WithOrigin t) Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep (WithOrigin t) = D1 ('MetaData "WithOrigin" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.1-inplace" 'False) (C1 ('MetaCons "Origin" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "At" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 t)))

at ∷ t → WithOrigin t Source #

fromWithOrigin ∷ t → WithOrigin t → t Source #

withOrigin ∷ b → (t → b) → WithOrigin t → b Source #

newtype EpochNo Source #

An epoch, i.e. the number of the epoch.

Constructors

EpochNo 

Fields

Instances

Instances details
FromJSON EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Enum EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Generic EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep EpochNoTypeType #

Methods

fromEpochNoRep EpochNo x #

toRep EpochNo x → EpochNo #

Show EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

showsPrecIntEpochNoShowS #

showEpochNoString #

showList ∷ [EpochNo] → ShowS #

FromCBOR EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBOREpochNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochNo] → Size Source #

NFData EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfEpochNo → () #

Eq EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(==)EpochNoEpochNoBool #

(/=)EpochNoEpochNoBool #

Ord EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

compareEpochNoEpochNoOrdering #

(<)EpochNoEpochNoBool #

(<=)EpochNoEpochNoBool #

(>)EpochNoEpochNoBool #

(>=)EpochNoEpochNoBool #

maxEpochNoEpochNoEpochNo #

minEpochNoEpochNoEpochNo #

NoThunks EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

Serialise EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochNo Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochNo = D1 ('MetaData "EpochNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.1-inplace" 'True) (C1 ('MetaCons "EpochNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

newtype EpochSize Source #

Constructors

EpochSize 

Fields

Instances

Instances details
FromJSON EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Enum EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Generic EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep EpochSizeTypeType #

Methods

fromEpochSizeRep EpochSize x #

toRep EpochSize x → EpochSize #

Show EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

showsPrecIntEpochSizeShowS #

showEpochSizeString #

showList ∷ [EpochSize] → ShowS #

FromCBOR EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBOREpochSizeEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochSizeSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochSize] → Size Source #

NFData EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfEpochSize → () #

Eq EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(==)EpochSizeEpochSizeBool #

(/=)EpochSizeEpochSizeBool #

Ord EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

NoThunks EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochSize Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochSize = D1 ('MetaData "EpochSize" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.1-inplace" 'True) (C1 ('MetaCons "EpochSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

newtype EpochInterval Source #

Constructors

EpochInterval 

Instances

Instances details
FromJSON EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

Generic EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep EpochIntervalTypeType #

Show EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

FromCBOR EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

NFData EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfEpochInterval → () #

Eq EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

Ord EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

NoThunks EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochInterval Source # 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochInterval = D1 ('MetaData "EpochInterval" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.1-inplace" 'True) (C1 ('MetaCons "EpochInterval" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochInterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

binOpEpochNo ∷ (Word64Word64Word64) → EpochNoEpochNoEpochNo Source #

Convenience function for doing binary operations on two EpochNos

addEpochIntervalEpochNoEpochIntervalEpochNo Source #

Add a EpochInterval (a positive change) to an EpochNo to get a new EpochNo