Safe Haskell | None |
---|---|
Language | Haskell2010 |
The module exposing the functionality of this package
- diffLists :: forall a. (Eq a, MemoTable a) => [a] -> [a] -> ListDiff a
- applyListDiff :: forall a. Eq a => ListDiff a -> [a] -> [a]
- diffFiles :: FilePath -> FilePath -> IO Filediff
- applyToFile :: Filediff -> FilePath -> IO [Line]
- diffDirectories :: FilePath -> FilePath -> IO Diff
- diffDirectoriesWithIgnoredSubdirs :: FilePath -> FilePath -> [FilePath] -> [FilePath] -> IO Diff
- applyToDirectory :: Diff -> FilePath -> IO ()
lists
diffLists :: forall a. (Eq a, MemoTable a) => [a] -> [a] -> ListDiff a Source
Computes the minimal number of additions and deletions needed to transform the first parameter into the second.
λ diffLists "abcdefg" "wabxyze" ListDiff {dels = [(2,'c'),(3,'d'),(5,'f'),(6,'g')], adds = [(0,'w'),(3,'x'),(4,'y'),(5,'z')]}
applyListDiff :: forall a. Eq a => ListDiff a -> [a] -> [a] Source
λ diffLists "abcdefg" "wabxyze" ListDiff {dels = [(2,'c'),(3,'d'),(5,'f'),(6,'g')], adds = [(0,'w'),(3,'x'),(4,'y'),(5,'z')]} λ applyListDiff it "abcdefg" "wabxyze"
Throws an exception if the diff can't be applied.
files
diffFiles :: FilePath -> FilePath -> IO Filediff Source
O(mn). Compute the difference between the two files (more specifically, the minimal number of changes to make to transform the file residing at the location specified by the first parameter into the second). Throws an exception if either or both of the parameters point to a directory, not a file.
Files are allowed to not exist at either or both of the parameters.
applyToFile :: Filediff -> FilePath -> IO [Line] Source
O(n). Apply a diff to a file. Throws an exception if the application fails.
directories
diffDirectories :: FilePath -> FilePath -> IO Diff Source
Compute the difference between the two directories (more specifically, the minimal number of changes to make to transform the directory residing at the location specified by the first parameter into the second). Throws an exception if either or both of the parameters point to a file, not a directory.