Skip to content

Commit

Permalink
Fix CI build (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriella439 authored Oct 24, 2024
1 parent 415463d commit 049fb80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nix-diff.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ executable nix-diff
, nix-diff
, aeson
, bytestring
, optparse-applicative >= 0.14.0.0 && < 0.18
, optparse-applicative
, text
, unix < 2.9
, containers
Expand Down
11 changes: 9 additions & 2 deletions src/Nix/Diff.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Reader (MonadReader, ReaderT, ask)
import Control.Monad.State (MonadState, StateT, get, put)
import Data.Attoparsec.Text (IResult(..), Parser)
import qualified Data.Functor as Functor (unzip)
import Data.List.NonEmpty (NonEmpty(..))
import Data.Map (Map)
import Data.Maybe (catMaybes)
import Data.Set (Set)
import Data.Text (Text)
import Data.Vector (Vector)
import Nix.Derivation (Derivation, DerivationOutput)
import Prelude hiding (unzip)

import qualified Control.Monad.Reader
import qualified Data.Attoparsec.Text
Expand Down Expand Up @@ -49,6 +49,13 @@ import Nix.Diff.Types
import Nix.Diff.Store (StorePath (StorePath, unsafeStorePathFile))
import qualified Nix.Diff.Store as Store

#if MIN_VERSION_base(4,19,0)
import Data.Functor (unzip)
#else
unzip :: Functor f => f (a, b) -> (f a, f b)
unzip xs = (fst <$> xs, snd <$> xs)
#endif

newtype Status = Status { visited :: Set Diffed }

data Diffed = Diffed
Expand Down Expand Up @@ -506,7 +513,7 @@ diff topLevel leftPath leftOutputs rightPath rightOutputs = do
else Nothing

let assocs = Data.Map.toList (innerJoin leftInputs rightInputs)
(descended, mInputsDiff) <- Functor.unzip <$> forM assocs \(inputName, (leftPaths, rightPaths)) -> do
(descended, mInputsDiff) <- unzip <$> forM assocs \(inputName, (leftPaths, rightPaths)) -> do
let leftExtraPaths =
Data.Map.difference leftPaths rightPaths
let rightExtraPaths =
Expand Down

0 comments on commit 049fb80

Please sign in to comment.