Skip to content

Commit fb07869

Browse files
committed
TOSQUASH annoying GHC version fixup
1 parent aeda17a commit fb07869

File tree

2 files changed

+13
-4
lines changed
  • ouroboros-consensus/src
    • ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync/Client
    • unstable-consensus-testlib/Test

2 files changed

+13
-4
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync/Client/Jumping.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE FlexibleContexts #-}
55
{-# LANGUAGE FlexibleInstances #-}
66
{-# LANGUAGE LambdaCase #-}
7+
{-# LANGUAGE NamedFieldPuns #-}
78
{-# LANGUAGE RankNTypes #-}
89
{-# LANGUAGE ScopedTypeVariables #-}
910
{-# LANGUAGE StandaloneDeriving #-}
@@ -303,7 +304,11 @@ mkJumping peerContext = Jumping
303304
atomically (nextInstruction (pure ()) peerContext) >>= \case
304305
Strict.Right instr -> pure instr
305306
Strict.Left () -> do
306-
traceWith (tracer peerContext) BlockedOnJump
307+
-- Need to use NamedFieldPuns somewhere in this module,
308+
-- otherwise stylish-haskell complains. But if I remove the
309+
-- LANGUAGE pragma, then there's a lot of name-shadowing
310+
-- warnings.
311+
traceWith (let Context{tracer} = peerContext in tracer) BlockedOnJump
307312
id
308313
$ fmap (Strict.either absurd id)
309314
$ atomically

ouroboros-consensus/src/unstable-consensus-testlib/Test/CsjModel.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Test.CsjModel (
2626

2727
import Cardano.Slotting.Slot (SlotNo (unSlotNo),
2828
WithOrigin (At, Origin))
29-
import Control.Applicative ((<|>))
29+
import Control.Applicative (Applicative (..), (<|>))
3030
import Control.Arrow (first)
3131
import Control.Monad (guard)
3232
import qualified Control.Monad.State.Strict as State
@@ -43,12 +43,16 @@ import Data.Strict.Maybe (Maybe (Just, Nothing), fromMaybe, maybe)
4343
import Data.Word (Word64)
4444
import GHC.Generics (Generic)
4545
import NoThunks.Class (NoThunks)
46-
import Prelude hiding (Either (Left, Right), Maybe (Just, Nothing),
47-
either, maybe)
46+
import Prelude hiding (Applicative (..), Either (Left, Right),
47+
Foldable (..), Maybe (Just, Nothing), either, maybe)
4848
import Test.CsjModel.NonEmptySeq
4949
import Test.CsjModel.Perm
5050
import Test.CsjModel.StateTypes
5151

52+
-- The weird Prelude hiding Applicative and Foldable trick in the above import
53+
-- list is to deal with recent versions of base adding exports of 'liftA2' and
54+
-- 'foldl''.
55+
5256
{-------------------------------------------------------------------------------
5357
Stimuli to and reactions of the CSJ governor
5458
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)