Skip to content

Commit 9e7ec69

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

File tree

2 files changed

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

2 files changed

+14
-4
lines changed

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

+6-1
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

+8-3
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,17 @@ 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 (..), Foldable(..),
47+
Either (Left, Right), Maybe (Just, Nothing), either,
48+
maybe)
4849
import Test.CsjModel.NonEmptySeq
4950
import Test.CsjModel.Perm
5051
import Test.CsjModel.StateTypes
5152

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

0 commit comments

Comments
 (0)