-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | File path glob-like matching -- -- A library for matching files using patterns such as -- "src/**/*.png" for all .png files recursively under -- the src directory. Features: -- --
-- getDirectoryFiles "myproject/src" ["**/*.h","**/*.c"] ---- -- If there are certain directories/files that should not be explored, -- use getDirectoryFilesIgnore. -- -- Warning: on case-insensitive file systems certain optimisations -- can cause surprising results. See the top of the module for details. getDirectoryFiles :: FilePath -> [FilePattern] -> IO [FilePath] -- | Get the files below a certain root matching any of the first set of -- FilePattern values, but don't return any files which match any -- ignore pattern (the final argument). Typically the ignore pattens will -- end with /**, e.g. .git/**. -- --
-- getDirectoryFilesIgnore "myproject/src" ["**/*.h","**/*.c"] [".git/**"] ---- -- Warning: on case-insensitive file systems certain optimisations -- can cause surprising results. See the top of the module for details. getDirectoryFilesIgnore :: FilePath -> [FilePattern] -> [FilePattern] -> IO [FilePath] -- | Like getDirectoryFilesIgnore but that the optimisations that -- may change behaviour on a case-insensitive file system. Note that this -- function will never return more results then -- getDirectoryFilesIgnore, and may return less. However, it will -- obey invariants such as: -- --
-- getDirectoryFilesIgnoreSlow root [x] [] ++ getDirectoryFilesIgnoreSlow root [y] [] -- == getDirectoryFilesIgnoreSlow root [x,y] [] ---- -- In contrast getDirectoryFilesIgnore only guarantees that -- invariant on case-sensitive file systems. getDirectoryFilesIgnoreSlow :: FilePath -> [FilePattern] -> [FilePattern] -> IO [FilePath] -- | A module for matching files using patterns such as -- "src/**/*.png" for all .png files recursively under -- the src directory. See ?== for the semantics of -- FilePattern values. Features: -- --
-- isJust (match p x) == (p ?== x) -- match "**/*.c" "test.txt" == Nothing -- match "**/*.c" "foo.c" == Just ["","foo"] -- match "**/*.c" "bar/baz/foo.c" == Just ["bar/baz/","foo"] ---- -- On Windows any \ path separators will be replaced by -- /. match :: FilePattern -> FilePath -> Maybe [String] -- | Given a successful match, substitute it back in to a pattern -- with the same arity. Raises an error if the number of parts -- does not match the arity of the pattern. -- --
-- p ?== x ==> substitute (fromJust $ match p x) p == x -- substitute "**/*.c" ["dir","file"] == "dir/file.c" --substitute :: Partial => FilePattern -> [String] -> FilePath -- | How many * and ** elements are there. -- --
-- arity "test.c" == 0 -- arity "**/*.c" == 2 --arity :: FilePattern -> Int -- | Efficient matching of a set of FilePatterns against a set of -- FilePaths. First call step passing in all the -- FilePatterns, with a tag for each one. Next call the methods of -- Step, providing the components of the FilePaths in turn. -- -- Useful for efficient bulk searching, particularly directory scanning, -- where you can avoid descending into directories which cannot match. step :: [(a, FilePattern)] -> Step a -- | Like step but using () as the tag for each -- FilePattern. step_ :: [FilePattern] -> Step () -- | The result of step, used to process successive path components -- of a set of FilePaths. data Step a Step :: [(a, [String])] -> StepNext -> (String -> Step a) -> Step a -- | The files that match at this step. Includes the list that would have -- been produced by match, along with the values passed to -- step. These results are not necessarily in order. [stepDone] :: Step a -> [(a, [String])] -- | Information about the results of calling stepApply. See -- StepNext for details. [stepNext] :: Step a -> StepNext -- | Apply one component from a FilePath to get a new Step. [stepApply] :: Step a -> String -> Step a -- | What we know about the next step values. data StepNext -- | All components not listed will result in dull Step values from -- stepApply, with stepNext being StepOnly -- [] and stepDone being []. The field is a set - -- their order is irrelevant but there will be no duplicates in values -- arising from step. StepOnly :: [String] -> StepNext -- | All calls to stepApply will return stepNext being -- StepEverything with a non-empty stepDone. StepEverything :: StepNext -- | We have no additional information about the output from -- stepApply. StepUnknown :: StepNext -- | Efficiently match many FilePatterns against many -- FilePaths in a single operation. Note that the returned matches -- are not guaranteed to be in any particular order. -- --
-- matchMany [(a, pat)] [(b, path)] == maybeToList (map (a,b,) (match pat path)) --matchMany :: [(a, FilePattern)] -> [(b, FilePath)] -> [(a, b, [String])]