-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Explain why two Nix derivations differ -- -- This package provides a nix-diff executable which explains -- why two Nix derivations (i.e. *.drv files) differ @package nix-diff @version 1.0.21 -- | A crude implementation of the Nix store concept. -- -- For anything fancier than this, it would be best to use FFI bindings -- instead, such as hercules-ci-cnix-store. module Nix.Diff.Store -- | A file path that may not exist on the true file system; needs to be -- looked up in a store, which may be relocated. -- -- Unlike the (C++) Nix StorePath type, subpaths are allowed. newtype StorePath StorePath :: FilePath -> StorePath -- | If the store is relocated, its physical location is elsewhere, and -- this FilePath won't resolve. Use toPhysicalPath. [$sel:unsafeStorePathFile:StorePath] :: StorePath -> FilePath toPhysicalPath :: StorePath -> IO FilePath -- | Convert a StorePath to a Text for display purposes. The -- path may not exist at this physical location. toText :: StorePath -> Text doesFileExist :: StorePath -> IO Bool readFileUtf8Lenient :: StorePath -> IO Text instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Store.StorePath instance Data.Aeson.Types.FromJSON.FromJSONKey Nix.Diff.Store.StorePath instance Data.Aeson.Types.ToJSON.ToJSONKey Nix.Diff.Store.StorePath instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Store.StorePath instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Store.StorePath instance GHC.Classes.Ord Nix.Diff.Store.StorePath instance GHC.Classes.Eq Nix.Diff.Store.StorePath instance GHC.Show.Show Nix.Diff.Store.StorePath instance Data.Data.Data Nix.Diff.Store.StorePath module Nix.Diff.Types data Changed a Changed :: a -> a -> Changed a [$sel:before:Changed] :: Changed a -> a [$sel:now:Changed] :: Changed a -> a newtype TextDiff TextDiff :: [Item Text] -> TextDiff [$sel:unTextDiff:TextDiff] :: TextDiff -> [Item Text] type OutputHash = Text type Platform = Text type Builder = Text type Argument = Text -- | A set of Nix derivation output names. newtype OutputNames OutputNames :: Set Text -> OutputNames [$sel:unOutputNames:OutputNames] :: OutputNames -> Set Text data DerivationDiff DerivationsAreTheSame :: DerivationDiff AlreadyCompared :: DerivationDiff OnlyAlreadyComparedBelow :: Changed OutputStructure -> DerivationDiff [$sel:outputStructure:DerivationsAreTheSame] :: DerivationDiff -> Changed OutputStructure NamesDontMatch :: Changed OutputStructure -> DerivationDiff [$sel:outputStructure:DerivationsAreTheSame] :: DerivationDiff -> Changed OutputStructure OutputsDontMatch :: Changed OutputStructure -> DerivationDiff [$sel:outputStructure:DerivationsAreTheSame] :: DerivationDiff -> Changed OutputStructure DerivationDiff :: Changed OutputStructure -> OutputsDiff -> Maybe (Changed Platform) -> Maybe (Changed Builder) -> Maybe ArgumentsDiff -> SourcesDiff -> InputsDiff -> Maybe EnvironmentDiff -> DerivationDiff [$sel:outputStructure:DerivationsAreTheSame] :: DerivationDiff -> Changed OutputStructure [$sel:outputsDiff:DerivationsAreTheSame] :: DerivationDiff -> OutputsDiff -- | Will be Nothing, if Platform does not change [$sel:platformDiff:DerivationsAreTheSame] :: DerivationDiff -> Maybe (Changed Platform) -- | Will be Nothing, if Builder does not change [$sel:builderDiff:DerivationsAreTheSame] :: DerivationDiff -> Maybe (Changed Builder) -- | Will be Nothing, if arguments are equal [$sel:argumentsDiff:DerivationsAreTheSame] :: DerivationDiff -> Maybe ArgumentsDiff [$sel:sourcesDiff:DerivationsAreTheSame] :: DerivationDiff -> SourcesDiff [$sel:inputsDiff:DerivationsAreTheSame] :: DerivationDiff -> InputsDiff -- | Will be Nothing, if environment comparison is skipped [$sel:envDiff:DerivationsAreTheSame] :: DerivationDiff -> Maybe EnvironmentDiff data OutputStructure OutputStructure :: StorePath -> OutputNames -> OutputStructure [$sel:derivationPath:OutputStructure] :: OutputStructure -> StorePath [$sel:derivationOutputs:OutputStructure] :: OutputStructure -> OutputNames data OutputsDiff OutputsDiff :: Maybe (Changed (Map Text (DerivationOutput StorePath Text))) -> [OutputDiff] -> OutputsDiff -- | Map from derivation name to its outputs. Will be Nothing, if -- difference gives empty Maps for both new and old outputs [$sel:extraOutputs:OutputsDiff] :: OutputsDiff -> Maybe (Changed (Map Text (DerivationOutput StorePath Text))) -- | Difference of outputs with the same name. Will be empty, if all -- outputs are equal. [$sel:outputHashDiff:OutputsDiff] :: OutputsDiff -> [OutputDiff] data OutputDiff OutputDiff :: Text -> Changed OutputHash -> OutputDiff [$sel:outputName:OutputDiff] :: OutputDiff -> Text [$sel:hashDifference:OutputDiff] :: OutputDiff -> Changed OutputHash newtype ArgumentsDiff ArgumentsDiff :: NonEmpty (Item Argument) -> ArgumentsDiff [$sel:unArgumetsDiff:ArgumentsDiff] :: ArgumentsDiff -> NonEmpty (Item Argument) data SourcesDiff SourcesDiff :: Maybe (Changed (Set Text)) -> [SourceFileDiff] -> SourcesDiff -- | Will be Nothing, if there is no extra source names [$sel:extraSrcNames:SourcesDiff] :: SourcesDiff -> Maybe (Changed (Set Text)) [$sel:srcFilesDiff:SourcesDiff] :: SourcesDiff -> [SourceFileDiff] data SourceFileDiff OneSourceFileDiff :: Text -> Maybe TextDiff -> SourceFileDiff [$sel:srcName:OneSourceFileDiff] :: SourceFileDiff -> Text -- | Will be Nothing, if any of source files not exists [$sel:srcContentDiff:OneSourceFileDiff] :: SourceFileDiff -> Maybe TextDiff SomeSourceFileDiff :: Text -> Changed [StorePath] -> SourceFileDiff [$sel:srcName:OneSourceFileDiff] :: SourceFileDiff -> Text [$sel:srcFileDiff:OneSourceFileDiff] :: SourceFileDiff -> Changed [StorePath] data InputsDiff InputsDiff :: Maybe (Changed (Set Text)) -> [InputDerivationsDiff] -> InputsDiff -- | Will be Nothing, if there is no extra input names [$sel:inputExtraNames:InputsDiff] :: InputsDiff -> Maybe (Changed (Set Text)) [$sel:inputDerivationDiffs:InputsDiff] :: InputsDiff -> [InputDerivationsDiff] data InputDerivationsDiff OneDerivationDiff :: Text -> DerivationDiff -> InputDerivationsDiff [$sel:drvName:OneDerivationDiff] :: InputDerivationsDiff -> Text [$sel:drvDiff:OneDerivationDiff] :: InputDerivationsDiff -> DerivationDiff SomeDerivationsDiff :: Text -> Changed (Map StorePath OutputNames) -> InputDerivationsDiff [$sel:drvName:OneDerivationDiff] :: InputDerivationsDiff -> Text [$sel:extraPartsDiff:OneDerivationDiff] :: InputDerivationsDiff -> Changed (Map StorePath OutputNames) -- | Many input derivations differ, but they've all already been compared. ManyDerivationsAlreadyComparedDiff :: Set Text -> InputDerivationsDiff [$sel:drvNames:OneDerivationDiff] :: InputDerivationsDiff -> Set Text data EnvironmentDiff EnvironmentsAreEqual :: EnvironmentDiff EnvironmentDiff :: Changed (Map Text Text) -> [EnvVarDiff] -> EnvironmentDiff [$sel:extraEnvDiff:EnvironmentsAreEqual] :: EnvironmentDiff -> Changed (Map Text Text) [$sel:envContentDiff:EnvironmentsAreEqual] :: EnvironmentDiff -> [EnvVarDiff] data EnvVarDiff EnvVarDiff :: Text -> TextDiff -> EnvVarDiff [$sel:envKey:EnvVarDiff] :: EnvVarDiff -> Text [$sel:envValueDiff:EnvVarDiff] :: EnvVarDiff -> TextDiff changedToJSON :: (a -> Value) -> Changed a -> Value changedFromJSON :: (Value -> Parser a) -> Value -> Parser (Changed a) itemToJSON :: ToJSON v => Item v -> Value itemFromJSON :: FromJSON v => Value -> Parser (Item v) arbitraryItem :: Arbitrary a => Gen (Item a) arbitraryDerivationOutput :: (Arbitrary fp, Arbitrary txt) => Gen (DerivationOutput fp txt) instance Data.Data.Data a => Data.Data.Data (Nix.Diff.Types.Changed a) instance GHC.Generics.Generic (Nix.Diff.Types.Changed a) instance Data.Traversable.Traversable Nix.Diff.Types.Changed instance Data.Foldable.Foldable Nix.Diff.Types.Changed instance GHC.Base.Functor Nix.Diff.Types.Changed instance GHC.Show.Show a => GHC.Show.Show (Nix.Diff.Types.Changed a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Nix.Diff.Types.Changed a) instance Data.Data.Data Nix.Diff.Types.TextDiff instance GHC.Show.Show Nix.Diff.Types.TextDiff instance GHC.Classes.Eq Nix.Diff.Types.TextDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.OutputNames instance Data.Data.Data Nix.Diff.Types.OutputNames instance GHC.Generics.Generic Nix.Diff.Types.OutputNames instance GHC.Show.Show Nix.Diff.Types.OutputNames instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.OutputNames instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.OutputNames instance GHC.Classes.Ord Nix.Diff.Types.OutputNames instance GHC.Classes.Eq Nix.Diff.Types.OutputNames instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.OutputStructure instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.OutputStructure instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.OutputStructure instance Data.Data.Data Nix.Diff.Types.OutputStructure instance GHC.Generics.Generic Nix.Diff.Types.OutputStructure instance GHC.Show.Show Nix.Diff.Types.OutputStructure instance GHC.Classes.Eq Nix.Diff.Types.OutputStructure instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.OutputDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.OutputDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.OutputDiff instance Data.Data.Data Nix.Diff.Types.OutputDiff instance GHC.Generics.Generic Nix.Diff.Types.OutputDiff instance GHC.Show.Show Nix.Diff.Types.OutputDiff instance GHC.Classes.Eq Nix.Diff.Types.OutputDiff instance Data.Data.Data Nix.Diff.Types.OutputsDiff instance GHC.Show.Show Nix.Diff.Types.OutputsDiff instance GHC.Classes.Eq Nix.Diff.Types.OutputsDiff instance Data.Data.Data Nix.Diff.Types.ArgumentsDiff instance GHC.Show.Show Nix.Diff.Types.ArgumentsDiff instance GHC.Classes.Eq Nix.Diff.Types.ArgumentsDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.SourceFileDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.SourceFileDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.SourceFileDiff instance Data.Data.Data Nix.Diff.Types.SourceFileDiff instance GHC.Generics.Generic Nix.Diff.Types.SourceFileDiff instance GHC.Show.Show Nix.Diff.Types.SourceFileDiff instance GHC.Classes.Eq Nix.Diff.Types.SourceFileDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.SourcesDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.SourcesDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.SourcesDiff instance Data.Data.Data Nix.Diff.Types.SourcesDiff instance GHC.Generics.Generic Nix.Diff.Types.SourcesDiff instance GHC.Show.Show Nix.Diff.Types.SourcesDiff instance GHC.Classes.Eq Nix.Diff.Types.SourcesDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.EnvVarDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.EnvVarDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.EnvVarDiff instance Data.Data.Data Nix.Diff.Types.EnvVarDiff instance GHC.Generics.Generic Nix.Diff.Types.EnvVarDiff instance GHC.Show.Show Nix.Diff.Types.EnvVarDiff instance GHC.Classes.Eq Nix.Diff.Types.EnvVarDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.EnvironmentDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.EnvironmentDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.EnvironmentDiff instance Data.Data.Data Nix.Diff.Types.EnvironmentDiff instance GHC.Generics.Generic Nix.Diff.Types.EnvironmentDiff instance GHC.Show.Show Nix.Diff.Types.EnvironmentDiff instance GHC.Classes.Eq Nix.Diff.Types.EnvironmentDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.InputDerivationsDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.InputDerivationsDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.InputDerivationsDiff instance Data.Data.Data Nix.Diff.Types.InputDerivationsDiff instance GHC.Generics.Generic Nix.Diff.Types.InputDerivationsDiff instance GHC.Show.Show Nix.Diff.Types.InputDerivationsDiff instance GHC.Classes.Eq Nix.Diff.Types.InputDerivationsDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.InputsDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.InputsDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.InputsDiff instance Data.Data.Data Nix.Diff.Types.InputsDiff instance GHC.Generics.Generic Nix.Diff.Types.InputsDiff instance GHC.Show.Show Nix.Diff.Types.InputsDiff instance GHC.Classes.Eq Nix.Diff.Types.InputsDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.DerivationDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.DerivationDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.DerivationDiff instance Data.Data.Data Nix.Diff.Types.DerivationDiff instance GHC.Generics.Generic Nix.Diff.Types.DerivationDiff instance GHC.Show.Show Nix.Diff.Types.DerivationDiff instance GHC.Classes.Eq Nix.Diff.Types.DerivationDiff instance Data.Data.Data (Nix.Derivation.Types.DerivationOutput Nix.Diff.Store.StorePath Data.Text.Internal.Text) instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.ArgumentsDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.ArgumentsDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.ArgumentsDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.OutputsDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.OutputsDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.OutputsDiff instance Test.QuickCheck.Arbitrary.Arbitrary Nix.Diff.Types.TextDiff instance Data.Aeson.Types.ToJSON.ToJSON Nix.Diff.Types.TextDiff instance Data.Aeson.Types.FromJSON.FromJSON Nix.Diff.Types.TextDiff instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Nix.Diff.Types.Changed a) instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Nix.Diff.Types.Changed a) instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Nix.Diff.Types.Changed a) module Nix.Diff.Transformations -- | In large diffs there may be a lot of derivations that doesn't change -- at all, but changed some of its nested inputs, that was already -- compared. This case will produce "stairs" of useless reports: ``` • -- The input derivation named a differs - -- nixstore/j1jmbxd74kzianaywml2nw1ja31a00r5-a.drv:{out} + -- nixstore/ww51c2dha7m5l5qjzh2rblicsamkrh62-a.drv:{out} • The -- input derivation named b differs - -- nixstore/j1jmbxd74kzianaywml2nw1ja31a00r5-b.drv:{out} + -- nixstore/ww51c2dha7m5l5qjzh2rblicsamkrh62-b.drv:{out} • The -- input derivation named c differs • These two derivations have -- already been compared ``` This transformation will fold all these -- subtrees of diff into one OnlyAlreadyComparedBelow. foldAlreadyComparedSubTrees :: DerivationDiff -> DerivationDiff -- | If packages deep in the dependency graph have been changed, many other -- derivations will also change in an uninteresting manner. This can lead -- to hundreds or thousands of lines of output like this: -- -- ``` • The input derivation named `bash-5.2p32` differs • These two -- derivations have already been compared • The input derivation named -- `ensure-newer-sources-hook` differs • These two derivations have -- already been compared • The input derivation named `pypa-install-hook` -- differs • These two derivations have already been compared ``` -- -- This transformation will fold sequences of OneDerivationDiff -- like this into a single ManyDerivationsAlreadyComparedDiff. foldManyInputDerivationsAlreadyCompared :: DerivationDiff -> DerivationDiff -- | This transformation is most useful for --json output, because it will -- sqash a lot of `{"content":" -- ","type":Both},{"content":When,"type":Both},{"content":" -- ","type":Both},{"content":"in","type":Both},{"content":" -- ","type":Both}` into one `{"content":" When in -- ","type":Both}` block. -- -- To understand this problem clearer, see -- `golden-testsexpected-outputsjson` and -- `golden-testsexpected-outputsjson-squashed`. -- -- _Warning_: this transformation can break some parts of printing in -- human readable mode. squashSourcesAndEnvsDiff :: DerivationDiff -> DerivationDiff transformNestedDerivationDiffs :: (DerivationDiff -> DerivationDiff) -> InputsDiff -> InputsDiff envSkippedOrUnchanged :: Maybe EnvironmentDiff -> Bool alreadyComparedBelow :: InputDerivationsDiff -> Bool transformIf :: Bool -> (DerivationDiff -> DerivationDiff) -> DerivationDiff -> DerivationDiff module Nix.Diff unzip :: Functor f => f (a, b) -> (f a, f b) newtype Status Status :: Set Diffed -> Status [$sel:visited:Status] :: Status -> Set Diffed data Diffed Diffed :: StorePath -> OutputNames -> StorePath -> OutputNames -> Diffed [$sel:leftDerivation:Diffed] :: Diffed -> StorePath [$sel:leftOutput:Diffed] :: Diffed -> OutputNames [$sel:rightDerivation:Diffed] :: Diffed -> StorePath [$sel:rightOutput:Diffed] :: Diffed -> OutputNames newtype Diff a Diff :: ReaderT DiffContext (StateT Status IO) a -> Diff a [$sel:unDiff:Diff] :: Diff a -> ReaderT DiffContext (StateT Status IO) a data DiffContext DiffContext :: Orientation -> Bool -> DiffContext [$sel:orientation:DiffContext] :: DiffContext -> Orientation [$sel:environment:DiffContext] :: DiffContext -> Bool data Orientation Character :: Orientation Word :: Orientation Line :: Orientation -- | 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
derivationName :: StorePath -> Text
-- | Group paths by their name
groupByName :: Map StorePath a -> Map Text (Map StorePath a)
-- | Extract the name of a build product
--
-- Similar to derivationName, this assumes that the path name is:
--
--
-- /nix/store/${32_CHARACTER_HASH}-${NAME}.drv
--
buildProductName :: StorePath -> Text
-- | Like groupByName, but for Sets
groupSetsByName :: Set StorePath -> Map Text (Set StorePath)
-- | 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.
readFileUtf8Lenient :: FilePath -> IO Text
storepathParser :: Parser StorePath
-- | Read and parse a derivation from a file
readDerivation :: StorePath -> Diff (Derivation StorePath Text)
-- | 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.
readInput :: StorePath -> Diff (Derivation StorePath Text)
-- | Join two Maps on shared keys, discarding keys which are not
-- present in both Maps
innerJoin :: Ord k => Map k a -> Map k b -> Map k (a, b)
getGroupedDiff :: Ord a => [a] -> [a] -> [Item [a]]
-- | Diff two outputs
diffOutput :: Text -> DerivationOutput StorePath Text -> DerivationOutput StorePath Text -> Maybe OutputDiff
-- | Diff two sets of outputs
diffOutputs :: Map Text (DerivationOutput StorePath Text) -> Map Text (DerivationOutput StorePath Text) -> OutputsDiff
-- | Split Text into spans of Text that alternatively fail
-- and satisfy the given predicate
--
-- The first span (if present) does not satisfy the predicate (even if
-- the span is empty)
--
-- -- >>> decomposeOn (== 'b') "aabbaa" -- ["aa","bb","aa"] -- -- >>> decomposeOn (== 'b') "bbaa" -- ["","bb","aa"] -- -- >>> decomposeOn (== 'b') "" -- [] --decomposeOn :: (Char -> Bool) -> Text -> [Text] lineBoundary :: Char -> Bool wordBoundary :: Char -> Bool -- | Diff two Text values diffText :: Text -> Text -> Diff TextDiff -- | Diff two environments diffEnv :: OutputNames -> OutputNames -> Map Text Text -> Map Text Text -> Diff EnvironmentDiff -- | Diff input sources diffSrcs :: Set StorePath -> Set StorePath -> Diff SourcesDiff diffPlatform :: Text -> Text -> Maybe (Changed Platform) diffBuilder :: Text -> Text -> Maybe (Changed Builder) diffArgs :: Vector Text -> Vector Text -> Maybe ArgumentsDiff diff :: Bool -> StorePath -> OutputNames -> StorePath -> OutputNames -> Diff DerivationDiff instance GHC.Classes.Ord Nix.Diff.Diffed instance GHC.Classes.Eq Nix.Diff.Diffed instance Control.Monad.Fail.MonadFail Nix.Diff.Diff instance Control.Monad.IO.Class.MonadIO Nix.Diff.Diff instance Control.Monad.State.Class.MonadState Nix.Diff.Status Nix.Diff.Diff instance Control.Monad.Reader.Class.MonadReader Nix.Diff.DiffContext Nix.Diff.Diff instance GHC.Base.Monad Nix.Diff.Diff instance GHC.Base.Applicative Nix.Diff.Diff instance GHC.Base.Functor Nix.Diff.Diff module Nix.Diff.Render.HumanReadable data RenderContext RenderContext :: Orientation -> TTY -> Natural -> Maybe Natural -> RenderContext [$sel:orientation:RenderContext] :: RenderContext -> Orientation [$sel:tty:RenderContext] :: RenderContext -> TTY [$sel:indent:RenderContext] :: RenderContext -> Natural [$sel:context:RenderContext] :: RenderContext -> Maybe Natural newtype Render a Render :: ReaderT RenderContext (Writer Text) a -> Render a [$sel:unRender:Render] :: Render a -> ReaderT RenderContext (Writer Text) a runRender :: Render a -> RenderContext -> (a, Text) runRender' :: Render () -> RenderContext -> Text echo :: Text -> Render () indented :: Natural -> Render a -> Render a data TTY IsTTY :: TTY NotTTY :: TTY -- | This exists to improve compatibility with less -R. See: -- -- https://github.com/Gabriella439/nix-diff/issues/95 escape :: Text -> Text -> Text -- | Color text red red :: TTY -> Text -> Text -- | Color text background red redBackground :: Orientation -> TTY -> Text -> Text -- | Color text green green :: TTY -> Text -> Text -- | Color text background green greenBackground :: Orientation -> TTY -> Text -> Text -- | Color text grey grey :: Orientation -> TTY -> Text -> Text -- | Format the left half of a diff minus :: TTY -> Text -> Text -- | Format the right half of a diff plus :: TTY -> Text -> Text -- | Format text explaining a diff explain :: Text -> Text -- | Utility to automate a common pattern of printing the two halves of a -- diff. This passes the correct formatting function to each half renderWith :: Changed a -> ((Text -> Text, a) -> Render ()) -> Render () -- | Format the derivation outputs renderOutputs :: OutputNames -> Text renderDiffHumanReadable :: DerivationDiff -> Render () zippers :: [a] -> [([a], a, [a])] instance Control.Monad.Writer.Class.MonadWriter Data.Text.Internal.Text Nix.Diff.Render.HumanReadable.Render instance Control.Monad.Reader.Class.MonadReader Nix.Diff.Render.HumanReadable.RenderContext Nix.Diff.Render.HumanReadable.Render instance GHC.Base.Monad Nix.Diff.Render.HumanReadable.Render instance GHC.Base.Applicative Nix.Diff.Render.HumanReadable.Render instance GHC.Base.Functor Nix.Diff.Render.HumanReadable.Render