cardano-ledger-core-1.17.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.BaseTypes.NonZero

Documentation

class KnownBounds a Source #

Associated Types

type MinBound a ∷ Nat Source #

type MaxBound a ∷ Nat Source #

Instances

Instances details
KnownBounds Word16 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Associated Types

type MinBound Word16Nat Source #

type MaxBound Word16Nat Source #

KnownBounds Word32 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Associated Types

type MinBound Word32Nat Source #

type MaxBound Word32Nat Source #

KnownBounds Word64 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Associated Types

type MinBound Word64Nat Source #

type MaxBound Word64Nat Source #

KnownBounds Word8 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Associated Types

type MinBound Word8Nat Source #

type MaxBound Word8Nat Source #

class HasZero a where Source #

Minimal complete definition

Nothing

Methods

isZero ∷ a → Bool Source #

default isZero ∷ (Eq a, Num a) ⇒ a → Bool Source #

Instances

Instances details
HasZero Word16 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroWord16Bool Source #

HasZero Word32 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroWord32Bool Source #

HasZero Word64 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroWord64Bool Source #

HasZero Word8 Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroWord8Bool Source #

HasZero Coin Source # 
Instance details

Defined in Cardano.Ledger.Coin

Methods

isZeroCoinBool Source #

HasZero Integer Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroIntegerBool Source #

HasZero Natural Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroNaturalBool Source #

HasZero Int Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroIntBool Source #

HasZero a ⇒ HasZero (Ratio a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

isZeroRatio a → Bool Source #

type WithinBounds n a = (MinBound a <= n, n <= MaxBound a) Source #

data NonZero a Source #

Instances

Instances details
(FromJSON a, HasZero a) ⇒ FromJSON (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

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

Defined in Cardano.Ledger.BaseTypes.NonZero

Show a ⇒ Show (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

showsPrecIntNonZero a → ShowS #

showNonZero a → String #

showList ∷ [NonZero a] → ShowS #

(Typeable a, DecCBOR a, HasZero a) ⇒ DecCBOR (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

decCBORDecoder s (NonZero a) Source #

dropCBORProxy (NonZero a) → Decoder s () Source #

labelProxy (NonZero a) → Text Source #

EncCBOR a ⇒ EncCBOR (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

encCBORNonZero a → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (NonZero a) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [NonZero a] → Size Source #

(ToPlutusData a, HasZero a) ⇒ ToPlutusData (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ToPlutusData

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

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

rnfNonZero a → () #

Eq a ⇒ Eq (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

(==)NonZero a → NonZero a → Bool #

(/=)NonZero a → NonZero a → Bool #

Ord a ⇒ Ord (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

Methods

compareNonZero a → NonZero a → Ordering #

(<)NonZero a → NonZero a → Bool #

(<=)NonZero a → NonZero a → Bool #

(>)NonZero a → NonZero a → Bool #

(>=)NonZero a → NonZero a → Bool #

maxNonZero a → NonZero a → NonZero a #

minNonZero a → NonZero a → NonZero a #

NoThunks a ⇒ NoThunks (NonZero a) Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes.NonZero

nonZeroHasZero a ⇒ a → Maybe (NonZero a) Source #

knownNonZero ∷ ∀ (n ∷ Nat). (KnownNat n, 1 <= n) ⇒ NonZero Integer Source #

knownNonZeroBounded ∷ ∀ (n ∷ Nat) a. (KnownNat n, 1 <= n, WithinBounds n a, Num a) ⇒ NonZero a Source #

(%.)Integral a ⇒ a → NonZero a → Ratio a infixl 7 Source #

bindNonZero ∷ (a → NonZero b) → NonZero a → NonZero b Source #

mapNonZero ∷ (Eq b, HasZero b) ⇒ (a → b) → NonZero a → Maybe (NonZero b) Source #

(/.)Fractional a ⇒ a → NonZero a → a infixl 7 Source #

nonZeroOrHasZero a ⇒ a → NonZero a → NonZero a Source #

mulNonZeroNat ∷ ∀ n a. (KnownNat n, 1 <= n, Integral a) ⇒ NonZero a → NonZero Integer Source #

(%?)Integral a ⇒ a → a → Ratio a infixl 7 Source #