cardano-api:internal
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Eon.ShelleyBasedEra

Synopsis

Shelley-based eras

data ShelleyBasedEra era where Source #

While the Byron and Shelley eras are quite different, there are several eras that are based on Shelley with only minor differences. It is useful to be able to treat the Shelley-based eras in a mostly-uniform way.

Values of this type witness the fact that the era is Shelley-based. This can be used to constrain the era to being a Shelley-based on. It allows non-uniform handling making case distinctions on the constructor.

Instances

Instances details
Eon ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Methods

inEonForEra :: a -> (ShelleyBasedEra era -> a) -> CardanoEra era -> a Source #

ToCardanoEra ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

TestEquality ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Convert AllegraEraOnwards ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.AllegraEraOnwards

Convert AlonzoEraOnwards ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.AlonzoEraOnwards

Convert BabbageEraOnwards ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.BabbageEraOnwards

Convert ConwayEraOnwards ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ConwayEraOnwards

Convert MaryEraOnwards ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.MaryEraOnwards

Convert ShelleyBasedEra CardanoEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Convert ShelleyEraOnly ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyEraOnly

Convert ShelleyToAllegraEra ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyToAllegraEra

Convert ShelleyToAlonzoEra ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyToAlonzoEra

Convert ShelleyToBabbageEra ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyToBabbageEra

Convert ShelleyToMaryEra ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyToMaryEra

Convert Era ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Experimental.Eras

Methods

convert :: Era era -> ShelleyBasedEra era Source #

ToJSON (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Methods

toJSON :: ShelleyBasedEra era -> Value #

toEncoding :: ShelleyBasedEra era -> Encoding #

toJSONList :: [ShelleyBasedEra era] -> Value #

toEncodingList :: [ShelleyBasedEra era] -> Encoding #

omitField :: ShelleyBasedEra era -> Bool #

Show (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

NFData (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Methods

rnf :: ShelleyBasedEra era -> () Source #

Eq (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Ord (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Pretty (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Methods

pretty :: ShelleyBasedEra era -> Doc ann #

prettyList :: [ShelleyBasedEra era] -> Doc ann #

class IsCardanoEra era => IsShelleyBasedEra era where Source #

The class of eras that are based on Shelley. This allows uniform handling of Shelley-based eras, but also non-uniform by making case distinctions on the ShelleyBasedEra constructors.

data AnyShelleyBasedEra where Source #

Constructors

AnyShelleyBasedEra :: forall era. Typeable era => ShelleyBasedEra era -> AnyShelleyBasedEra 

Instances

Instances details
FromJSON AnyShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

ToJSON AnyShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Bounded AnyShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Enum AnyShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Show AnyShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

Eq AnyShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Eon.ShelleyBasedEra

data InAnyShelleyBasedEra (thing :: Type -> Type) where Source #

This pairs up some era-dependent type with a ShelleyBasedEra value that tells us what era it is, but hides the era type. This is useful when the era is not statically known, for example when deserialising from a file.

Constructors

InAnyShelleyBasedEra :: forall era (thing :: Type -> Type). Typeable era => ShelleyBasedEra era -> thing era -> InAnyShelleyBasedEra thing 

inEonForShelleyBasedEra :: Eon eon => a -> (eon era -> a) -> ShelleyBasedEra era -> a Source #

Determine the value to use for a feature in a given ShelleyBasedEra.

inEonForShelleyBasedEraMaybe :: Eon eon => (eon era -> a) -> ShelleyBasedEra era -> Maybe a Source #

forShelleyBasedEraInEon :: Eon eon => ShelleyBasedEra era -> a -> (eon era -> a) -> a Source #

forShelleyBasedEraInEonMaybe :: Eon eon => ShelleyBasedEra era -> (eon era -> a) -> Maybe a Source #

Assertions on era

Mapping to era types from the Shelley ledger library

type family ShelleyLedgerEra era = (ledgerera :: Type) | ledgerera -> era where ... Source #

A type family that connects our era type tags to equivalent type tags used in the Shelley ledger library.

This type mapping connect types from this API with types in the Shelley ledger library which allows writing conversion functions in a more generic way.

eraProtVerLow :: ShelleyBasedEra era -> Version Source #

Lookup the lower major protocol version for the shelley based era. In other words this is the major protocol version that the era has started in.