Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Status = Status {}
- data Diffed = Diffed {}
- newtype Diff a = Diff {}
- data DiffContext = DiffContext {}
- data Orientation
- derivationName :: FilePath -> Text
- groupByName :: Map FilePath a -> Map Text (Map FilePath a)
- buildProductName :: FilePath -> Text
- groupSetsByName :: Set FilePath -> Map Text (Set FilePath)
- readFileUtf8Lenient :: FilePath -> IO Text
- readDerivation :: FilePath -> Diff (Derivation FilePath Text)
- readInput :: FilePath -> Diff (Derivation FilePath Text)
- innerJoin :: Ord k => Map k a -> Map k b -> Map k (a, b)
- getGroupedDiff :: Ord a => [a] -> [a] -> [Item [a]]
- diffOutput :: Text -> DerivationOutput FilePath Text -> DerivationOutput FilePath Text -> Maybe OutputDiff
- diffOutputs :: Map Text (DerivationOutput FilePath Text) -> Map Text (DerivationOutput FilePath Text) -> OutputsDiff
- decomposeOn :: (Char -> Bool) -> Text -> [Text]
- lineBoundary :: Char -> Bool
- wordBoundary :: Char -> Bool
- diffText :: Text -> Text -> Diff TextDiff
- diffEnv :: Set Text -> Set Text -> Map Text Text -> Map Text Text -> Diff EnvironmentDiff
- diffSrcs :: Set FilePath -> Set FilePath -> Diff SourcesDiff
- diffPlatform :: Text -> Text -> Maybe (Changed Platform)
- diffBuilder :: Text -> Text -> Maybe (Changed Builder)
- diffArgs :: Vector Text -> Vector Text -> Maybe ArgumentsDiff
- diff :: Bool -> FilePath -> Set Text -> FilePath -> Set Text -> Diff DerivationDiff
Documentation
Diffed | |
|
Instances
MonadFail Diff Source # | |
MonadIO Diff Source # | |
Applicative Diff Source # | |
Functor Diff Source # | |
Monad Diff Source # | |
MonadReader DiffContext Diff Source # | |
Defined in Nix.Diff ask :: Diff DiffContext # local :: (DiffContext -> DiffContext) -> Diff a -> Diff a # reader :: (DiffContext -> a) -> Diff a # | |
MonadState Status Diff Source # | |
data DiffContext Source #
Instances
MonadReader DiffContext Diff Source # | |
Defined in Nix.Diff ask :: Diff DiffContext # local :: (DiffContext -> DiffContext) -> Diff a -> Diff a # reader :: (DiffContext -> a) -> Diff a # |
derivationName :: FilePath -> Text Source #
Extract the name of a derivation (i.e. the part after the hash)
This is used to guess which derivations are related to one another, even though their hash might differ
Note that this assumes that the path name is:
/nix/store/${32_CHARACTER_HASH}-${NAME}.drv
Nix technically does not require that the Nix store is actually stored underneath `nixstore`, but this is the overwhelmingly common use case
buildProductName :: FilePath -> Text Source #
Extract the name of a build product
Similar to derivationName
, this assumes that the path name is:
/nix/store/${32_CHARACTER_HASH}-${NAME}.drv
readFileUtf8Lenient :: FilePath -> IO Text Source #
Read a file as utf-8 encoded string, replacing non-utf-8 characters
with the unicode replacement character.
This is necessary since derivations (and nix source code!) can in principle
contain arbitrary bytes, but `nix-derivation` can only parse from Text
.
readDerivation :: FilePath -> Diff (Derivation FilePath Text) Source #
Read and parse a derivation from a file
readInput :: FilePath -> Diff (Derivation FilePath Text) Source #
Read and parse a derivation from a store path that can be a derivation (.drv) or a realized path, in which case the corresponding derivation is queried.
getGroupedDiff :: Ord a => [a] -> [a] -> [Item [a]] Source #
:: Text | Output name |
-> DerivationOutput FilePath Text | Left derivation outputs |
-> DerivationOutput FilePath Text | Right derivation outputs |
-> Maybe OutputDiff |
Diff two outputs
:: Map Text (DerivationOutput FilePath Text) | Left derivation outputs |
-> Map Text (DerivationOutput FilePath Text) | Right derivation outputs |
-> OutputsDiff |
Diff two sets of outputs
lineBoundary :: Char -> Bool Source #
wordBoundary :: Char -> Bool Source #
:: Text | Left value to compare |
-> Text | Right value to compare |
-> Diff TextDiff | List of blocks of diffed text |
Diff two Text
values
:: Set Text | Left derivation outputs |
-> Set Text | Right derivation outputs |
-> Map Text Text | Left environment to compare |
-> Map Text Text | Right environment to compare |
-> Diff EnvironmentDiff |
Diff two environments
Diff input sources