Skip to content

Commit 664b599

Browse files
committed
Remove CPP pragmas for GHC 810
1 parent 4cb07e9 commit 664b599

File tree

14 files changed

+24
-93
lines changed

14 files changed

+24
-93
lines changed

eras/babbage/impl/testlib/Test/Cardano/Ledger/Babbage/ImpTest.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
{-# LANGUAGE ScopedTypeVariables #-}
66
{-# LANGUAGE TypeFamilies #-}
77
{-# LANGUAGE UndecidableInstances #-}
8-
#if __GLASGOW_HASKELL__ < 900
9-
{-# LANGUAGE IncoherentInstances #-}
10-
#endif
118
{-# OPTIONS_GHC -Wno-orphans #-}
129

1310
module Test.Cardano.Ledger.Babbage.ImpTest (

eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
module Test.Cardano.Ledger.Shelley.ImpTest (
2626
ImpTestM,
27-
BaseImpM,
2827
LedgerSpec,
2928
SomeSTSEvent (..),
3029
ImpTestState,
@@ -267,20 +266,6 @@ import UnliftIO (evaluateDeep)
267266

268267
type ImpTestM era = ImpM (LedgerSpec era)
269268

270-
-- TODO remove this once we get rid of the CPP directives
271-
{- FOURMOLU_DISABLE -}
272-
type BaseImpM a = -- TODO get rid of the CPP once we have deprecated GHC8
273-
#if __GLASGOW_HASKELL__ < 906
274-
Expectation
275-
#else
276-
forall t. ImpM t a
277-
-- ^ Note the use of higher ranked types here. This prevents the hook from
278-
-- accessing the state while still permitting the use of more general
279-
-- functions that return some `ImpM t a` and that don't constrain the
280-
-- state in any way (e.g. `logString`, `shouldBe` are still fine to use).
281-
#endif
282-
{- FOURMOLU_ENABLE -}
283-
284269
data LedgerSpec era
285270

286271
instance ShelleyEraImp era => ImpSpec (LedgerSpec era) where
@@ -594,14 +579,15 @@ modifyImpInitProtVer ver =
594579

595580
modifyImpInitExpectLedgerRuleConformance ::
596581
forall era.
597-
( Globals ->
582+
( forall t.
583+
Globals ->
598584
Either
599585
(NonEmpty (PredicateFailure (EraRule "LEDGER" era)))
600586
(State (EraRule "LEDGER" era), [Event (EraRule "LEDGER" era)]) ->
601587
LedgerEnv era ->
602588
LedgerState era ->
603589
Tx era ->
604-
BaseImpM ()
590+
ImpM t ()
605591
) ->
606592
SpecWith (ImpInit (LedgerSpec era)) ->
607593
SpecWith (ImpInit (LedgerSpec era))
@@ -753,14 +739,15 @@ impWitsVKeyNeeded txBody = do
753739
data ImpTestEnv era = ImpTestEnv
754740
{ iteFixup :: Tx era -> ImpTestM era (Tx era)
755741
, iteExpectLedgerRuleConformance ::
742+
forall t.
756743
Globals ->
757744
Either
758745
(NonEmpty (PredicateFailure (EraRule "LEDGER" era)))
759746
(State (EraRule "LEDGER" era), [Event (EraRule "LEDGER" era)]) ->
760747
LedgerEnv era ->
761748
LedgerState era ->
762749
Tx era ->
763-
BaseImpM ()
750+
ImpM t ()
764751
, iteCborRoundTripFailures :: Bool
765752
-- ^ Expect failures in CBOR round trip serialization tests for predicate failures
766753
}
@@ -772,14 +759,15 @@ iteExpectLedgerRuleConformanceL ::
772759
forall era.
773760
Lens'
774761
(ImpTestEnv era)
775-
( Globals ->
762+
( forall t.
763+
Globals ->
776764
Either
777765
(NonEmpty (PredicateFailure (EraRule "LEDGER" era)))
778766
(State (EraRule "LEDGER" era), [Event (EraRule "LEDGER" era)]) ->
779767
LedgerEnv era ->
780768
LedgerState era ->
781769
Tx era ->
782-
BaseImpM ()
770+
ImpM t ()
783771
)
784772
iteExpectLedgerRuleConformanceL = lens iteExpectLedgerRuleConformance (\x y -> x {iteExpectLedgerRuleConformance = y})
785773

@@ -1037,8 +1025,6 @@ submitTx_ = void . submitTx
10371025
submitTx :: (HasCallStack, ShelleyEraImp era) => Tx era -> ImpTestM era (Tx era)
10381026
submitTx tx = trySubmitTx tx >>= expectRightDeepExpr . first fst
10391027

1040-
-- TODO remove this once we get rid of the CPP directives
1041-
{- FOURMOLU_DISABLE -}
10421028
trySubmitTx ::
10431029
forall era.
10441030
( ShelleyEraImp era
@@ -1058,12 +1044,7 @@ trySubmitTx tx = do
10581044

10591045
-- Check for conformance
10601046
asks iteExpectLedgerRuleConformance
1061-
-- TODO get rid of the CPP once we have deprecated GHC8
1062-
#if __GLASGOW_HASKELL__ < 906
1063-
>>= (\f -> liftIO $ f globals res lEnv (st ^. nesEsL . esLStateL) txFixed)
1064-
#else
10651047
>>= (\f -> f globals res lEnv (st ^. nesEsL . esLStateL) txFixed)
1066-
#endif
10671048

10681049
case res of
10691050
Left predFailures -> do
@@ -1097,7 +1078,6 @@ trySubmitTx tx = do
10971078
impRootTxInL .= newRoot
10981079
expectTxSuccess txFixed
10991080
pure $ Right txFixed
1100-
{- FOURMOLU_ENABLE -}
11011081

11021082
-- | Submit a transaction that is expected to be rejected with the given predicate failures.
11031083
-- The inputs and outputs are automatically balanced.

libs/cardano-ledger-conformance/test/Test/Cardano/Ledger/Conformance/Imp.hs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ import Test.Cardano.Ledger.Conway.ImpTest
4747
import Test.Cardano.Ledger.Imp.Common hiding (Args)
4848
import UnliftIO (evaluateDeep)
4949

50-
-- TODO remove this once we get rid of the CPP directives
51-
{- FOURMOLU_DISABLE -}
5250
testImpConformance ::
53-
forall era.
51+
forall era t.
5452
( ConwayEraImp era
5553
, ExecSpecRule "LEDGER" era
5654
, ExecContext "LEDGER" era ~ ConwayLedgerExecContext era
@@ -74,7 +72,7 @@ testImpConformance ::
7472
ExecEnvironment "LEDGER" era ->
7573
ExecState "LEDGER" era ->
7674
ExecSignal "LEDGER" era ->
77-
BaseImpM ()
75+
ImpM t ()
7876
testImpConformance _globals impRuleResult env state signal = do
7977
let ctx =
8078
ConwayLedgerExecContext
@@ -113,7 +111,6 @@ testImpConformance _globals impRuleResult env state signal = do
113111
(toTestRep . inject @_ @(ExecState "LEDGER" era) . fst)
114112
impRuleResult
115113

116-
#if __GLASGOW_HASKELL__ >= 906
117114
logString "implEnv"
118115
logToExpr env
119116
logString "implState"
@@ -136,10 +133,8 @@ testImpConformance _globals impRuleResult env state signal = do
136133
signal
137134
(first showOpaqueErrorString impRuleResult)
138135
logDoc $ diffConformance impResponse agdaResponse
139-
#endif
140136
when (impResponse /= agdaResponse) $
141137
assertFailure "Conformance failure"
142-
{- FOURMOLU_ENABLE -}
143138

144139
spec :: Spec
145140
spec =

libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes/NonZero.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ import Data.Typeable (Typeable)
4848
import Data.Word (Word16, Word32, Word64, Word8)
4949
import GHC.TypeLits
5050
import NoThunks.Class (NoThunks)
51-
#if __GLASGOW_HASKELL__ < 900
52-
import Numeric.Natural (Natural)
53-
#endif
5451

5552
class KnownBounds a where
5653
type MinBound a :: Nat

libs/cardano-ledger-core/src/Cardano/Ledger/HKD.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ module Cardano.Ledger.HKD (
1717
NoUpdate (..),
1818
HKDApplicative (..),
1919
) where
20-
#if __GLASGOW_HASKELL__ < 906
21-
import Control.Applicative (liftA2)
22-
#endif
20+
2321
import Control.DeepSeq (NFData)
2422
import Data.Functor.Identity (Identity)
2523
import Data.Maybe.Strict (StrictMaybe (..))

libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances/Basic.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
{-# LANGUAGE UndecidableSuperClasses #-}
1717
{-# OPTIONS_GHC -Wno-orphans #-}
1818

19-
-- RecordWildCards cause name shadowing warnings in ghc-8.10.
20-
#if __GLASGOW_HASKELL__ < 900
21-
{-# OPTIONS_GHC -Wno-name-shadowing #-}
22-
{-# OPTIONS_GHC -O0 #-}
23-
#endif
24-
2519
-- | This module provides `HasSpec` and `HasSimpleRep` instances for
2620
-- Basic types. A type is 'Basic' if it is used to define PParams.
2721
-- See Test.Cardano.Ledger.Constrained.Conway.SimplePParams

libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances/Ledger.hs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,10 @@
1919
{-# LANGUAGE TypeFamilies #-}
2020
{-# LANGUAGE TypeOperators #-}
2121
{-# LANGUAGE UndecidableInstances #-}
22-
{-# LANGUAGE ViewPatterns #-}
2322
{-# OPTIONS_GHC -Wno-orphans #-}
2423
-- GHC9.2.8 needs this
2524
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
2625

27-
-- RecordWildCards cause name shadowing warnings in ghc-8.10.
28-
#if __GLASGOW_HASKELL__ < 900
29-
{-# OPTIONS_GHC -Wno-name-shadowing #-}
30-
{-# OPTIONS_GHC -O0 #-}
31-
#endif
32-
3326
-- | This module provides the necessary instances of `HasSpec`
3427
-- and `HasSimpleRep` to write specs for the environments,
3528
-- states, and signals in the STS rules of the Ledger. Note some simple
@@ -1092,7 +1085,7 @@ instance (Era era, EraSpecPParams era) => HasSpec (GovActionState era)
10921085

10931086
gasId_ ::
10941087
Term (GovActionState ConwayEra) ->
1095-
Term (GovActionId)
1088+
Term GovActionId
10961089
gasId_ = sel @0
10971090

10981091
gasCommitteeVotes_ ::

libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Instances/PParams.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
{-# LANGUAGE UndecidableSuperClasses #-}
1515
{-# OPTIONS_GHC -Wno-orphans #-}
1616

17-
-- RecordWildCards cause name shadowing warnings in ghc-8.10.
18-
#if __GLASGOW_HASKELL__ < 900
19-
{-# OPTIONS_GHC -Wno-name-shadowing #-}
20-
#endif
21-
2217
-- | This module provides the necessary instances of `HasSpec`
2318
-- and `HasSimpleRep` for the components of PParams. It hides
2419
-- the fact that (PParams era) can have different underlying 'data' types

libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/LedgerTypes/WellFormed.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
{-# LANGUAGE UndecidableInstances #-}
1313
{-# LANGUAGE UndecidableSuperClasses #-}
1414

15-
#if __GLASGOW_HASKELL__ < 900
16-
{-# OPTIONS_GHC -O0 #-}
17-
#endif
18-
1915
module Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.WellFormed where
2016

2117
import Cardano.Ledger.Api

libs/constrained-generators/src/Constrained/NumSpec.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{-# LANGUAGE FlexibleContexts #-}
88
{-# LANGUAGE FlexibleInstances #-}
99
{-# LANGUAGE GADTs #-}
10-
{-# LANGUAGE LambdaCase #-}
1110
{-# LANGUAGE MultiParamTypeClasses #-}
1211
{-# LANGUAGE OverloadedStrings #-}
1312
{-# LANGUAGE PatternSynonyms #-}
@@ -18,7 +17,6 @@
1817
{-# LANGUAGE TypeOperators #-}
1918
{-# LANGUAGE UndecidableInstances #-}
2019
{-# LANGUAGE UndecidableSuperClasses #-}
21-
{-# LANGUAGE ViewPatterns #-}
2220
-- Random Natural, Arbitrary Natural, Uniform Natural
2321
{-# OPTIONS_GHC -Wno-orphans #-}
2422

0 commit comments

Comments
 (0)