Skip to content

Commit

Permalink
Experimental ghc-9.6 support
Browse files Browse the repository at this point in the history
Also requires #4281 (io-classes-1.0.0.1).
  • Loading branch information
coot committed Apr 28, 2023
1 parent 25c30d7 commit 6b7cfd6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cardano-ping/cardano-ping.cabal
Expand Up @@ -33,7 +33,7 @@ library
strict-stm,

network-mux >=0.3 && <0.4,
tdigest >=0.2.1.1 && <0.3,
tdigest ^>=0.3,
text >=1.2.4 && <2.1,

-- The Windows version of network-3.1.2 is missing
Expand Down
Expand Up @@ -8,7 +8,6 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE UndecidableInstances #-}

-- | Drivers for running 'Peer's.
Expand Down
Expand Up @@ -8,7 +8,6 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
-- @UndecidableInstances@ extensions is required for defining @Show@ instance
-- of @'TraceSendRecv'@.
{-# LANGUAGE UndecidableInstances #-}
Expand Down
6 changes: 6 additions & 0 deletions ouroboros-network-framework/src/Ouroboros/Network/Snocket.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GADTs #-}
Expand Down Expand Up @@ -102,6 +103,7 @@ import Ouroboros.Network.IOManager
newtype Accept m fd addr = Accept
{ runAccept :: m (Accepted fd addr, Accept m fd addr)
}
deriving Functor

instance Functor m => Bifunctor (Accept m) where
bimap f g (Accept ac) = Accept (h <$> ac)
Expand All @@ -113,6 +115,10 @@ data Accepted fd addr where
AcceptFailure :: !SomeException -> Accepted fd addr
Accepted :: !fd -> !addr -> Accepted fd addr

instance Functor (Accepted fd) where
fmap f (Accepted fd addr) = Accepted fd (f addr)
fmap _ (AcceptFailure err) = AcceptFailure err

instance Bifunctor Accepted where
bimap f g (Accepted fd addr) = Accepted (f fd) (g addr)
bimap _ _ (AcceptFailure err) = AcceptFailure err
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-network-testing/ouroboros-network-testing.cabal
Expand Up @@ -61,7 +61,7 @@ library
build-depends: base >=4.14 && <4.19,
containers,
contra-tracer,
deque,
deque ^>=0.4,
io-classes ^>=1.1,
io-sim,
psqueues >=0.2.3 && <0.3,
Expand Down

0 comments on commit 6b7cfd6

Please sign in to comment.