| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Shelley.Spec.Ledger.BaseTypes
Contents
Synopsis
- type FixedPoint = Digits34
- (==>) :: Bool -> Bool -> Bool
- (⭒) :: Nonce -> Nonce -> Nonce
- data Network
- networkToWord8 :: Network -> Word8
- word8ToNetwork :: Word8 -> Maybe Network
- data Nonce
- = Nonce !(Hash Blake2b_256 Nonce)
- | NeutralNonce
- newtype Seed = Seed (Hash Blake2b_256 Seed)
- data UnitInterval
- fpPrecision :: FixedPoint
- interval0 :: UnitInterval
- intervalValue :: UnitInterval -> Ratio Word64
- unitIntervalToRational :: UnitInterval -> Rational
- unitIntervalFromRational :: Rational -> UnitInterval
- invalidKey :: Word -> Decoder s a
- mkNonceFromOutputVRF :: OutputVRF v -> Nonce
- mkNonceFromNumber :: Word64 -> Nonce
- mkUnitInterval :: Ratio Word64 -> Maybe UnitInterval
- truncateUnitInterval :: Ratio Word64 -> UnitInterval
- data StrictMaybe a
- strictMaybeToMaybe :: StrictMaybe a -> Maybe a
- maybeToStrictMaybe :: Maybe a -> StrictMaybe a
- fromSMaybe :: a -> StrictMaybe a -> a
- data Url
- urlToText :: Url -> Text
- textToUrl :: Text -> Maybe Url
- data DnsName
- dnsToText :: DnsName -> Text
- textToDns :: Text -> Maybe DnsName
- newtype Port = Port {}
- data ActiveSlotCoeff
- mkActiveSlotCoeff :: UnitInterval -> ActiveSlotCoeff
- activeSlotVal :: ActiveSlotCoeff -> UnitInterval
- activeSlotLog :: ActiveSlotCoeff -> FixedPoint
- data Globals = Globals {}
- type ShelleyBase = ReaderT Globals Identity
Documentation
type FixedPoint = Digits34 Source #
Instances
| Bounded Network Source # | |
| Enum Network Source # | |
| Eq Network Source # | |
| Ord Network Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| Show Network Source # | |
| Generic Network Source # | |
| NFData Network Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| ToJSON Network Source # | |
| FromJSON Network Source # | |
| ToCBOR Network Source # | |
| FromCBOR Network Source # | |
| NoThunks Network Source # | |
| type Rep Network Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
networkToWord8 :: Network -> Word8 Source #
Evolving nonce type.
Constructors
| Nonce !(Hash Blake2b_256 Nonce) | |
| NeutralNonce | Identity element |
Instances
| Eq Nonce Source # | |
| Ord Nonce Source # | |
| Show Nonce Source # | |
| Generic Nonce Source # | |
| NFData Nonce Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| ToJSON Nonce Source # | |
| FromJSON Nonce Source # | |
| ToCBOR Nonce Source # | |
| FromCBOR Nonce Source # | |
| NoThunks Nonce Source # | |
| type Rep Nonce Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes type Rep Nonce = D1 ('MetaData "Nonce" "Shelley.Spec.Ledger.BaseTypes" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "Nonce" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash Blake2b_256 Nonce))) :+: C1 ('MetaCons "NeutralNonce" 'PrefixI 'False) (U1 :: Type -> Type)) | |
Seed to the verifiable random function.
We do not expose the constructor to Seed. Instead, a Seed should be
created using mkSeed for a VRF calculation.
Constructors
| Seed (Hash Blake2b_256 Seed) |
data UnitInterval Source #
Type to represent a value in the unit interval [0; 1]
Instances
intervalValue :: UnitInterval -> Ratio Word64 Source #
Get rational value of UnitInterval type
invalidKey :: Word -> Decoder s a Source #
mkNonceFromOutputVRF :: OutputVRF v -> Nonce Source #
Make a nonce from the VRF output bytes
mkNonceFromNumber :: Word64 -> Nonce Source #
Make a nonce from a number.
mkUnitInterval :: Ratio Word64 -> Maybe UnitInterval Source #
Return a UnitInterval type if r is in [0; 1].
truncateUnitInterval :: Ratio Word64 -> UnitInterval Source #
Convert a rational to a UnitInterval by ignoring its integer part.
data StrictMaybe a Source #
Strict Maybe.
TODO move to cardano-prelude
Instances
strictMaybeToMaybe :: StrictMaybe a -> Maybe a Source #
maybeToStrictMaybe :: Maybe a -> StrictMaybe a Source #
fromSMaybe :: a -> StrictMaybe a -> a Source #
Instances
| Eq Url Source # | |
| Ord Url Source # | |
| Show Url Source # | |
| Generic Url Source # | |
| NFData Url Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| ToJSON Url Source # | |
| FromJSON Url Source # | |
| ToCBOR Url Source # | |
| FromCBOR Url Source # | |
| NoThunks Url Source # | |
| type Rep Url Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
Instances
| Eq DnsName Source # | |
| Ord DnsName Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| Show DnsName Source # | |
| Generic DnsName Source # | |
| NFData DnsName Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| ToJSON DnsName Source # | |
| FromJSON DnsName Source # | |
| ToCBOR DnsName Source # | |
| FromCBOR DnsName Source # | |
| NoThunks DnsName Source # | |
| type Rep DnsName Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
Constructors
| Port | |
Fields | |
Instances
| Eq Port Source # | |
| Num Port Source # | |
| Ord Port Source # | |
| Show Port Source # | |
| Generic Port Source # | |
| NFData Port Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
| ToJSON Port Source # | |
| FromJSON Port Source # | |
| ToCBOR Port Source # | |
| FromCBOR Port Source # | |
| NoThunks Port Source # | |
| type Rep Port Source # | |
Defined in Shelley.Spec.Ledger.BaseTypes | |
data ActiveSlotCoeff Source #
Instances
STS Base
Constructors
| Globals | |
Fields
| |