1 From daae423d339e820e3fe8c720bd568cc49eae3fde Mon Sep 17 00:00:00 2001
2 From: Rodney Lorrimar <dev@rodney.id.au>
3 Date: Tue, 25 Jul 2023 16:46:36 +0800
4 Subject: [PATCH] GHC 9.4 compatibility
6 This is commit b89eed9 from haskell-nix/hnix master branch,
9 The patch should be removed once hnix-0.17 is released.
12 src/Nix/Fresh.hs | 2 +-
13 src/Nix/Lint.hs | 2 +-
14 src/Nix/Utils.hs | 2 +-
15 src/Nix/Value.hs | 2 +-
16 4 files changed, 4 insertions(+), 4 deletions(-)
18 diff --git a/src/Nix/Fresh.hs b/src/Nix/Fresh.hs
19 index fdd20c4a..4b55de4e 100644
20 --- a/src/Nix/Fresh.hs
21 +++ b/src/Nix/Fresh.hs
22 @@ -14,7 +14,7 @@ import Control.Monad.Catch ( MonadCatch
26 -import Control.Monad.Except ( MonadFix )
27 +import Control.Monad.Fix ( MonadFix )
28 import Control.Monad.Ref ( MonadAtomicRef(..)
31 diff --git a/src/Nix/Lint.hs b/src/Nix/Lint.hs
32 index 2c207c91..3da8c298 100644
35 @@ -498,7 +498,7 @@ instance MonadThrow (Lint s) where
36 throwM e = Lint $ ReaderT $ const (throw e)
38 instance MonadCatch (Lint s) where
39 - catch _m _h = Lint $ ReaderT $ const (fail "Cannot catch in 'Lint s'")
40 + catch _m _h = Lint $ ReaderT $ const (error "Cannot catch in 'Lint s'")
42 runLintM :: Options -> Lint s a -> ST s a
43 runLintM opts action =
44 diff --git a/src/Nix/Utils.hs b/src/Nix/Utils.hs
45 index 8f53b3a7..af370c21 100644
46 --- a/src/Nix/Utils.hs
47 +++ b/src/Nix/Utils.hs
48 @@ -67,6 +67,7 @@ import Relude hiding ( pass
49 import Data.Binary ( Binary )
50 import Data.Data ( Data )
51 import Codec.Serialise ( Serialise )
52 +import Control.Monad ( foldM )
53 import Control.Monad.Fix ( MonadFix(..) )
54 import Control.Monad.Free ( Free(..) )
55 import Control.Monad.Trans.Control ( MonadTransControl(..) )
56 @@ -84,7 +85,6 @@ import Lens.Family2.Stock ( _1
59 import qualified System.FilePath as FilePath
60 -import Control.Monad.List (foldM)
63 import qualified Relude.Debug as X
64 diff --git a/src/Nix/Value.hs b/src/Nix/Value.hs
65 index aafdc25a..28b9508c 100644
66 --- a/src/Nix/Value.hs
67 +++ b/src/Nix/Value.hs
68 @@ -554,7 +554,7 @@ liftNValue
69 => (forall x . u m x -> m x)
72 -liftNValue = (`hoistNValue` lift)
73 +liftNValue f = hoistNValue f lift
76 -- *** MonadTransUnlift