From 651b7ef6310ec8bac4504a4909459d873d5b9b6f Mon Sep 17 00:00:00 2001 From: Hongrui Fang Date: Thu, 11 Aug 2022 06:09:44 +0800 Subject: [PATCH] remove unused `SOP.Generic` derivations --- agora/Agora/Effect.hs | 9 +++++- agora/Agora/Effect/GovernorMutation.hs | 7 ----- agora/Agora/Effect/TreasuryWithdrawal.hs | 7 ----- agora/Agora/Governor.hs | 11 ------- agora/Agora/Proposal.hs | 37 ++---------------------- agora/Agora/Proposal/Time.hs | 17 +---------- agora/Agora/Stake.hs | 14 --------- agora/Agora/Treasury.hs | 4 --- 8 files changed, 12 insertions(+), 94 deletions(-) diff --git a/agora/Agora/Effect.hs b/agora/Agora/Effect.hs index 96a7b32..4f94426 100644 --- a/agora/Agora/Effect.hs +++ b/agora/Agora/Effect.hs @@ -8,7 +8,14 @@ Helpers for constructing effects. module Agora.Effect (makeEffect) where import Agora.AuthorityToken (singleAuthorityTokenBurned) -import Plutarch.Api.V1 (PCurrencySymbol, PScriptPurpose (PSpending), PTxInfo, PTxOutRef, PValidator, PValue) +import Plutarch.Api.V1 ( + PCurrencySymbol, + PScriptPurpose (PSpending), + PTxInfo, + PTxOutRef, + PValidator, + PValue, + ) import Plutarch.Extra.TermCont (pguardC, pletC, pletFieldsC, pmatchC, ptryFromC) import Plutarch.TryFrom () import PlutusLedgerApi.V1.Value (CurrencySymbol) diff --git a/agora/Agora/Effect/GovernorMutation.hs b/agora/Agora/Effect/GovernorMutation.hs index ce26a40..22f539c 100644 --- a/agora/Agora/Effect/GovernorMutation.hs +++ b/agora/Agora/Effect/GovernorMutation.hs @@ -26,7 +26,6 @@ import Agora.Governor ( ) import Agora.Plutarch.Orphans () import Agora.Scripts (AgoraScripts, authorityTokenSymbol, governorSTAssetClass) -import Generics.SOP qualified as SOP import Plutarch.Api.V1 ( PTxOutRef, PValidator, @@ -66,10 +65,6 @@ data MutateGovernorDatum = MutateGovernorDatum , -- | @since 0.1.ç Generic ) - deriving anyclass - ( -- | @since 0.1.ç - SOP.Generic - ) PlutusTx.makeIsDataIndexed ''MutateGovernorDatum [('MutateGovernorDatum, 0)] @@ -95,8 +90,6 @@ newtype PMutateGovernorDatum (s :: S) ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData diff --git a/agora/Agora/Effect/TreasuryWithdrawal.hs b/agora/Agora/Effect/TreasuryWithdrawal.hs index 53e1336..3bb058b 100644 --- a/agora/Agora/Effect/TreasuryWithdrawal.hs +++ b/agora/Agora/Effect/TreasuryWithdrawal.hs @@ -15,7 +15,6 @@ module Agora.Effect.TreasuryWithdrawal ( import Agora.Effect (makeEffect) import Agora.Plutarch.Orphans () -import Generics.SOP qualified as SOP import Plutarch.Api.V1 ( AmountGuarantees (Positive), KeyGuarantees (Sorted), @@ -57,10 +56,6 @@ data TreasuryWithdrawalDatum = TreasuryWithdrawalDatum , -- | @since 0.1.0 Generic ) - deriving anyclass - ( -- | @since 0.1.0 - SOP.Generic - ) -- | @since 0.1.0 PlutusTx.makeLift ''TreasuryWithdrawalDatum @@ -88,8 +83,6 @@ newtype PTreasuryWithdrawalDatum (s :: S) ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData diff --git a/agora/Agora/Governor.hs b/agora/Agora/Governor.hs index 9f53b7f..6d594ed 100644 --- a/agora/Agora/Governor.hs +++ b/agora/Agora/Governor.hs @@ -40,7 +40,6 @@ import Agora.Proposal.Time ( ) import Agora.SafeMoney (GTTag) import Data.Tagged (Tagged (..)) -import Generics.SOP qualified as SOP import Plutarch.DataRepr ( DerivePConstantViaData (..), PDataFields, @@ -114,10 +113,6 @@ data GovernorRedeemer , -- | @since 0.2.0 Bounded ) - deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - ) deriving ( -- | @since 0.1.0 PlutusTx.ToData @@ -169,10 +164,6 @@ newtype PGovernorDatum (s :: S) = PGovernorDatum ( -- | @since 0.1.0 Generic ) - deriving anyclass - ( -- | @since 0.1.0 - SOP.Generic - ) deriving anyclass ( -- | @since 0.1.0 PlutusType @@ -215,8 +206,6 @@ data PGovernorRedeemer (s :: S) ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData diff --git a/agora/Agora/Proposal.hs b/agora/Agora/Proposal.hs index eee62f8..8bc70af 100644 --- a/agora/Agora/Proposal.hs +++ b/agora/Agora/Proposal.hs @@ -108,10 +108,6 @@ newtype ProposalId = ProposalId {proposalTag :: Integer} , -- | @since 0.1.0 PlutusTx.UnsafeFromData ) - deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - ) {- | Encodes a result. Typically, for a Yes/No proposal, we encode it like this: @@ -141,10 +137,6 @@ newtype ResultTag = ResultTag {getResultTag :: Integer} , -- | @since 0.1.0 PlutusTx.UnsafeFromData ) - deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - ) {- | The "status" of the proposal. This is only useful for state transitions that need to happen as a result of a transaction as opposed to time-based "periods". @@ -240,7 +232,6 @@ data ProposalThresholds = ProposalThresholds , -- | @since 0.1.0 Generic ) - deriving anyclass (SOP.Generic) PlutusTx.makeIsDataIndexed 'ProposalThresholds [('ProposalThresholds, 0)] @@ -274,10 +265,6 @@ newtype ProposalVotes = ProposalVotes , -- | @since 0.1.0 PlutusTx.FromData ) - deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - ) {- | Create a 'ProposalVotes' that has the same shape as the 'effects' field. @@ -384,10 +371,6 @@ data ProposalRedeemer , -- | @since 0.1.0 Generic ) - deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - ) -- | @since 0.1.0 PlutusTx.makeIsDataIndexed @@ -411,9 +394,7 @@ newtype PResultTag (s :: S) = PResultTag (Term s PInteger) Generic ) deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - , -- @since 0.1.0 + ( -- @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -453,9 +434,7 @@ newtype PProposalId (s :: S) = PProposalId (Term s PInteger) Generic ) deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - , -- | @since 0.1.0 + ( -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -508,8 +487,6 @@ data PProposalStatus (s :: S) ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -551,8 +528,6 @@ newtype PProposalThresholds (s :: S) = PProposalThresholds ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -587,9 +562,7 @@ newtype PProposalVotes (s :: S) Generic ) deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - , -- | @since 0.1.0 + ( -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -637,8 +610,6 @@ newtype PProposalDatum (s :: S) = PProposalDatum ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -673,8 +644,6 @@ data PProposalRedeemer (s :: S) ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData diff --git a/agora/Agora/Proposal/Time.hs b/agora/Agora/Proposal/Time.hs index f50c3a3..97d6196 100644 --- a/agora/Agora/Proposal/Time.hs +++ b/agora/Agora/Proposal/Time.hs @@ -31,7 +31,6 @@ module Agora.Proposal.Time ( ) where import Control.Composition ((.*)) -import Generics.SOP qualified as SOP import Plutarch.Api.V1 ( PExtended (PFinite), PInterval (PInterval), @@ -107,10 +106,6 @@ data ProposalTimingConfig = ProposalTimingConfig , -- | @since 0.1.0 Generic ) - deriving anyclass - ( -- | @since 0.1.0 - SOP.Generic - ) PlutusTx.makeIsDataIndexed 'ProposalTimingConfig [('ProposalTimingConfig, 0)] @@ -174,10 +169,6 @@ data PProposalTime (s :: S) = PProposalTime ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 - SOP.HasDatatypeInfo - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PEq @@ -194,8 +185,6 @@ newtype PProposalStartingTime (s :: S) = PProposalStartingTime (Term s PPOSIXTim ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -240,8 +229,6 @@ newtype PProposalTimingConfig (s :: S) = PProposalTimingConfig ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -273,9 +260,7 @@ newtype PMaxTimeRangeWidth (s :: S) Generic ) deriving anyclass - ( -- | @since 0.2.0 - SOP.Generic - , -- | @since 0.1.0 + ( -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData diff --git a/agora/Agora/Stake.hs b/agora/Agora/Stake.hs index 094fc54..423f347 100644 --- a/agora/Agora/Stake.hs +++ b/agora/Agora/Stake.hs @@ -114,10 +114,6 @@ data ProposalLock , -- | @since 0.1.0 Generic ) - deriving anyclass - ( -- | @since 0.1.0 - SOP.Generic - ) PlutusTx.makeIsDataIndexed ''ProposalLock @@ -234,8 +230,6 @@ newtype PStakeDatum (s :: S) = PStakeDatum ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -329,10 +323,6 @@ data PProposalLock (s :: S) ) deriving anyclass ( -- | @since 0.1.0 - SOP.Generic - , -- | @since 0.1.0 - SOP.HasDatatypeInfo - , -- | @since 0.1.0 PlutusType , -- | @since 0.1.0 PIsData @@ -419,11 +409,7 @@ data PStakeRole (s :: S) ) deriving anyclass ( -- | @since 0.2.0 - SOP.Generic - , -- | @since 0.2.0 PlutusType - , -- | @since 0.2.0 - SOP.HasDatatypeInfo , -- | @since 0.2.0 PEq ) diff --git a/agora/Agora/Treasury.hs b/agora/Agora/Treasury.hs index 6b66b7b..e5b3733 100644 --- a/agora/Agora/Treasury.hs +++ b/agora/Agora/Treasury.hs @@ -75,10 +75,6 @@ data PTreasuryRedeemer (s :: S) , -- | @since 0.2.0 Enum ) - deriving anyclass - ( -- | @since 0.1.0 - SOP.Generic - ) deriving anyclass ( -- | @since 0.1.0 PlutusType