From f978ed06c89931467aa2a3909cf7bb156ea490d7 Mon Sep 17 00:00:00 2001 From: John Ky Date: Tue, 10 Oct 2023 00:20:42 +1100 Subject: [PATCH] Delete EraCast type class and EraCastError type --- cardano-api/cardano-api.cabal | 1 - cardano-api/internal/Cardano/Api/EraCast.hs | 28 --------------------- cardano-api/src/Cardano/Api.hs | 5 ---- 3 files changed, 34 deletions(-) delete mode 100644 cardano-api/internal/Cardano/Api/EraCast.hs diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index 81c09323f9..baf6c06f98 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -73,7 +73,6 @@ library internal Cardano.Api.Eon.ShelleyToAlonzoEra Cardano.Api.Eon.ShelleyToBabbageEra Cardano.Api.Eon.ShelleyToMaryEra - Cardano.Api.EraCast Cardano.Api.Eras Cardano.Api.Eras.Case Cardano.Api.Eras.Constraints diff --git a/cardano-api/internal/Cardano/Api/EraCast.hs b/cardano-api/internal/Cardano/Api/EraCast.hs deleted file mode 100644 index 8e2a911a4d..0000000000 --- a/cardano-api/internal/Cardano/Api/EraCast.hs +++ /dev/null @@ -1,28 +0,0 @@ -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} - -module Cardano.Api.EraCast - ( EraCast(..) - , EraCastError(..) - ) where - -import Cardano.Api.Eras (CardanoEra (..), IsCardanoEra) - -import Data.Kind (Type) - -data EraCastError = forall fromEra toEra value. - ( IsCardanoEra fromEra - , IsCardanoEra toEra - , Show value - ) => - EraCastError - { originalValue :: value - , fromEra :: CardanoEra fromEra - , toEra :: CardanoEra toEra - } - -class EraCast (f :: Type -> Type) where - eraCast :: (IsCardanoEra fromEra, IsCardanoEra toEra) - => CardanoEra toEra - -> f fromEra - -> Either EraCastError (f toEra) diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index a3aeb131ae..8f550b97b1 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -934,10 +934,6 @@ module Cardano.Api ( parseFilePath, writeSecrets, - -- ** Cast functions - EraCast (..), - EraCastError (..), - -- * Convenience functions -- ** Transaction construction @@ -1037,7 +1033,6 @@ import Cardano.Api.Eon.ShelleyToAllegraEra import Cardano.Api.Eon.ShelleyToAlonzoEra import Cardano.Api.Eon.ShelleyToBabbageEra import Cardano.Api.Eon.ShelleyToMaryEra -import Cardano.Api.EraCast import Cardano.Api.Eras import Cardano.Api.Eras.Case import Cardano.Api.Eras.Constraints