{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} module Cardano.Api.Eon.ByronToAlonzoEra ( ByronToAlonzoEra (..) , byronToAlonzoEraConstraints , ByronToAlonzoEraConstraints ) where import Cardano.Api.Eon.Convert import Cardano.Api.Eras.Core import Data.Typeable (Typeable) data ByronToAlonzoEra era where ByronToAlonzoEraByron :: ByronToAlonzoEra ByronEra ByronToAlonzoEraShelley :: ByronToAlonzoEra ShelleyEra ByronToAlonzoEraAllegra :: ByronToAlonzoEra AllegraEra ByronToAlonzoEraMary :: ByronToAlonzoEra MaryEra ByronToAlonzoEraAlonzo :: ByronToAlonzoEra AlonzoEra deriving instance Show (ByronToAlonzoEra era) deriving instance Eq (ByronToAlonzoEra era) instance Eon ByronToAlonzoEra where inEonForEra :: forall a era. a -> (ByronToAlonzoEra era -> a) -> CardanoEra era -> a inEonForEra a no ByronToAlonzoEra era -> a yes = \case CardanoEra era ByronEra -> ByronToAlonzoEra era -> a yes ByronToAlonzoEra era ByronToAlonzoEra ByronEra ByronToAlonzoEraByron CardanoEra era ShelleyEra -> ByronToAlonzoEra era -> a yes ByronToAlonzoEra era ByronToAlonzoEra ShelleyEra ByronToAlonzoEraShelley CardanoEra era AllegraEra -> ByronToAlonzoEra era -> a yes ByronToAlonzoEra era ByronToAlonzoEra AllegraEra ByronToAlonzoEraAllegra CardanoEra era MaryEra -> ByronToAlonzoEra era -> a yes ByronToAlonzoEra era ByronToAlonzoEra MaryEra ByronToAlonzoEraMary CardanoEra era AlonzoEra -> ByronToAlonzoEra era -> a yes ByronToAlonzoEra era ByronToAlonzoEra AlonzoEra ByronToAlonzoEraAlonzo CardanoEra era BabbageEra -> a no CardanoEra era ConwayEra -> a no instance ToCardanoEra ByronToAlonzoEra where toCardanoEra :: forall era. ByronToAlonzoEra era -> CardanoEra era toCardanoEra = \case ByronToAlonzoEra era ByronToAlonzoEraByron -> CardanoEra era CardanoEra ByronEra ByronEra ByronToAlonzoEra era ByronToAlonzoEraShelley -> CardanoEra era CardanoEra ShelleyEra ShelleyEra ByronToAlonzoEra era ByronToAlonzoEraAllegra -> CardanoEra era CardanoEra AllegraEra AllegraEra ByronToAlonzoEra era ByronToAlonzoEraMary -> CardanoEra era CardanoEra MaryEra MaryEra ByronToAlonzoEra era ByronToAlonzoEraAlonzo -> CardanoEra era CardanoEra AlonzoEra AlonzoEra instance Convert ByronToAlonzoEra CardanoEra where convert :: forall era. ByronToAlonzoEra era -> CardanoEra era convert = ByronToAlonzoEra era -> CardanoEra era forall era. ByronToAlonzoEra era -> CardanoEra era forall (eon :: * -> *) era. ToCardanoEra eon => eon era -> CardanoEra era toCardanoEra type ByronToAlonzoEraConstraints era = ( IsCardanoEra era , Typeable era ) byronToAlonzoEraConstraints :: () => ByronToAlonzoEra era -> (ByronToAlonzoEraConstraints era => a) -> a byronToAlonzoEraConstraints :: forall era a. ByronToAlonzoEra era -> (ByronToAlonzoEraConstraints era => a) -> a byronToAlonzoEraConstraints = \case ByronToAlonzoEra era ByronToAlonzoEraByron -> a -> a (ByronToAlonzoEraConstraints era => a) -> a forall a. a -> a id ByronToAlonzoEra era ByronToAlonzoEraShelley -> a -> a (ByronToAlonzoEraConstraints era => a) -> a forall a. a -> a id ByronToAlonzoEra era ByronToAlonzoEraAllegra -> a -> a (ByronToAlonzoEraConstraints era => a) -> a forall a. a -> a id ByronToAlonzoEra era ByronToAlonzoEraMary -> a -> a (ByronToAlonzoEraConstraints era => a) -> a forall a. a -> a id ByronToAlonzoEra era ByronToAlonzoEraAlonzo -> a -> a (ByronToAlonzoEraConstraints era => a) -> a forall a. a -> a id