diff --git a/cardano-api/internal/Cardano/Api/Eras.hs b/cardano-api/internal/Cardano/Api/Eras.hs index eefb6ef176..d4380435a5 100644 --- a/cardano-api/internal/Cardano/Api/Eras.hs +++ b/cardano-api/internal/Cardano/Api/Eras.hs @@ -22,8 +22,7 @@ module Cardano.Api.Eras -- * IsEon , Eon(..) - , AnyEon(..) - , AnyEraInEon(..) + , EraInEon(..) , inEonForEraMaybe , forEraInEon diff --git a/cardano-api/internal/Cardano/Api/Eras/Core.hs b/cardano-api/internal/Cardano/Api/Eras/Core.hs index d7bef7fad5..f14bd50399 100644 --- a/cardano-api/internal/Cardano/Api/Eras/Core.hs +++ b/cardano-api/internal/Cardano/Api/Eras/Core.hs @@ -30,8 +30,7 @@ module Cardano.Api.Eras.Core -- * IsEon , Eon(..) - , AnyEon(..) - , AnyEraInEon(..) + , EraInEon(..) , inEonForEraMaybe , forEraInEon , forEraInEonMaybe @@ -163,38 +162,24 @@ maybeEon = -- ---------------------------------------------------------------------------- -- Era and eon existential types -data AnyEraInEon eon where - AnyEraInEon +data EraInEon eon where + EraInEon :: ( Typeable era , Typeable (eon era) - , Eon eon ) + , Eon eon + ) => eon era - -> AnyEraInEon eon + -> EraInEon eon -- | Assumes that eons are singletons -instance Show (AnyEraInEon eon) where - showsPrec _ (AnyEraInEon eonEra) = showsTypeRep (typeOf eonEra) +instance Show (EraInEon eon) where + showsPrec _ (EraInEon eonEra) = showsTypeRep (typeOf eonEra) -- | Assumes that eons are singletons -instance TestEquality eon => Eq (AnyEraInEon eon) where - AnyEraInEon era1 == AnyEraInEon era2 = +instance TestEquality eon => Eq (EraInEon eon) where + EraInEon era1 == EraInEon era2 = isJust $ testEquality era1 era2 -data AnyEon where - AnyEon - :: ( Typeable era - , Typeable (eon era) - , ToCardanoEra eon - , IsCardanoEra era - , Eon eon ) - => eon era - -> AnyEon - --- | Assumes that eons are singletons -instance Show AnyEon where - showsPrec _ (AnyEon eonEra) = showsTypeRep (typeOf eonEra) - - -- ---------------------------------------------------------------------------- -- ToCardanoEra diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index 743dc02d6c..5dcdbe1200 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -29,8 +29,7 @@ module Cardano.Api ( -- * Eon support Eon(..), - AnyEon(..), - AnyEraInEon(..), + EraInEon(..), inEonForEraMaybe, forEraInEon,