From c92fd21e586e6baa0239783e11fd79dbba43c896 Mon Sep 17 00:00:00 2001 From: Alexey Kuleshevich Date: Mon, 4 Apr 2022 00:48:34 +0300 Subject: [PATCH] Minor cleanup to Mempool: reduce Applicaitve to Functor and remove redundant language extensions --- .../src/Cardano/Ledger/Shelley/API/Mempool.hs | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs index cb9b1369549..57b22d051f8 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs @@ -1,6 +1,4 @@ -{-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE DataKinds #-} -{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} @@ -132,13 +130,6 @@ class MempoolState era -> Core.Tx era -> m (MempoolState era, Validated (Core.Tx era)) - default applyTx :: - MonadError (ApplyTxError era) m => - Globals -> - MempoolEnv era -> - MempoolState era -> - Core.Tx era -> - m (MempoolState era, Validated (Core.Tx era)) applyTx globals env state tx = let res = flip runReader globals @@ -167,13 +158,6 @@ class MempoolState era -> Validated (Core.Tx era) -> m (MempoolState era) - default reapplyTx :: - MonadError (ApplyTxError era) m => - Globals -> - MempoolEnv era -> - MempoolState era -> - Validated (Core.Tx era) -> - m (MempoolState era) reapplyTx globals env state (Validated tx) = let res = flip runReader globals @@ -254,8 +238,7 @@ instance -- | Old 'applyTxs' applyTxs :: - ApplyTx era => - MonadError (ApplyTxError era) m => + (ApplyTx era, MonadError (ApplyTxError era) m) => Globals -> SlotNo -> Seq (Core.Tx era) -> @@ -289,7 +272,7 @@ applyTxsTransition globals env txs state = -- | Transform a function over mempool states to one over the full -- 'NewEpochState'. overNewEpochState :: - Applicative f => + Functor f => (MempoolState era -> f (MempoolState era)) -> NewEpochState era -> f (NewEpochState era)