Combinators for finding files recursively. The combinators all surround the find
function.
- data FilePather a
- (<?>) :: FilePather a -> FilePath -> a
- filePather :: (FilePath -> a) -> FilePather a
- filePath :: FilePather FilePath
- always :: FilePather Bool
- always' :: FilePather (a -> Bool)
- never :: FilePather Bool
- never' :: FilePather (a -> Bool)
- extension :: FilePather FilePath
- extension' :: FilePather (a -> FilePath)
- directory :: FilePather FilePath
- directory' :: FilePather (a -> FilePath)
- hasExtension :: FilePather Bool
- hasExtension' :: FilePather (a -> Bool)
- splitExtension :: FilePather (String, String)
- splitExtension' :: FilePather (a -> (String, String))
- splitDirectories :: FilePather [FilePath]
- splitDirectories' :: FilePather (a -> [FilePath])
- hasTrailingPathSeparator :: FilePather Bool
- hasTrailingPathSeparator' :: FilePather (a -> Bool)
- fileName :: FilePather FilePath
- fileName' :: FilePather (a -> FilePath)
- baseName :: FilePather FilePath
- baseName' :: FilePather (a -> FilePath)
- normalise :: FilePather FilePath
- normalise' :: FilePather (a -> FilePath)
- makeValid :: FilePather FilePath
- makeValid' :: FilePather (a -> FilePath)
- isRelative :: FilePather Bool
- isRelative' :: FilePather (a -> Bool)
- isAbsolute :: FilePather Bool
- isAbsolute' :: FilePather (a -> Bool)
- isValid :: FilePather Bool
- isValid' :: FilePather (a -> Bool)
- not' :: Functor f => f Bool -> f Bool
- constant :: Functor f => f a -> f (t -> a)
- (==?) :: (Eq a, Functor f) => f a -> a -> f Bool
- (/=?) :: (Eq a, Functor f) => f a -> a -> f Bool
- (==||) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f Bool
- (/=||) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f Bool
- (==&&) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f Bool
- (/=&&) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f Bool
- (==>) :: Applicative f => f Bool -> f Bool -> f Bool
- (===>) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)
- (/=>) :: Applicative f => f Bool -> f Bool -> f Bool
- (/==>) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)
- (&&?) :: Applicative f => f Bool -> f Bool -> f Bool
- (?&&?) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)
- (||?) :: Applicative f => f Bool -> f Bool -> f Bool
- (?||?) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)
- data FileType
- type RecursePredicate = FilePather Bool
- type FilterPredicate = FilePather (FileType -> Bool)
- isFile :: Applicative f => f (FileType -> Bool)
- isDirectory :: Applicative f => f (FileType -> Bool)
- isUnknown :: Applicative f => f (FileType -> Bool)
- find :: RecursePredicate -> FilterPredicate -> FilePath -> IO [FilePath]
Documentation
data FilePather a Source
A function that takes a FilePath
and produces a value.
Constructor and unwrapper
(<?>) :: FilePather a -> FilePath -> aSource
filePather :: (FilePath -> a) -> FilePather aSource
Construct a FilePather
from the given function
Values using System.FilePath
filePath :: FilePather FilePathSource
A value that runs the identity function.
always :: FilePather BoolSource
A value that always produces the value True
.
always' :: FilePather (a -> Bool)Source
A value using a constant function that produces the value True
.
never :: FilePather BoolSource
A value that always produces the value False
.
never' :: FilePather (a -> Bool)Source
A value that always produces a constant function that produces the value False
.
extension :: FilePather FilePathSource
A value that produces the extension of the given FilePath
.
extension' :: FilePather (a -> FilePath)Source
A value using a constant function that produces the extension of the given FilePath
.
directory :: FilePather FilePathSource
A value that produces the directory of the given FilePath
.
directory' :: FilePather (a -> FilePath)Source
A value using a constant function that produces the directory of the given FilePath
.
hasExtension :: FilePather BoolSource
A value that produces a value denoting whether or not the given FilePath
has an extension.
hasExtension' :: FilePather (a -> Bool)Source
A value using a constant function that produces a value denoting whether or not the given FilePath
has an extension.
splitExtension :: FilePather (String, String)Source
A value that produces a value splitting the given FilePath
by its extension.
splitExtension' :: FilePather (a -> (String, String))Source
A value using a constant function that produces a value splitting the given FilePath
by its extension.
splitDirectories :: FilePather [FilePath]Source
A value that produces a value splitting the given FilePath
into its directories.
splitDirectories' :: FilePather (a -> [FilePath])Source
A value using a constant function that produces a value splitting the given FilePath
into its directories.
hasTrailingPathSeparator :: FilePather BoolSource
A value that produces a value denoting whether or not the given FilePath
has a trailing path separator.
hasTrailingPathSeparator' :: FilePather (a -> Bool)Source
A value using a constant function that produces a value denoting whether or not the given FilePath
has a trailing path separator.
fileName :: FilePather FilePathSource
A value that produces the file name of the given FilePath
.
fileName' :: FilePather (a -> FilePath)Source
A value using a constant function that produces the file name of the given FilePath
.
baseName :: FilePather FilePathSource
A value that produces the base name of the given FilePath
.
baseName' :: FilePather (a -> FilePath)Source
A value using a constant function that produces the base name of the given FilePath
.
normalise :: FilePather FilePathSource
A value that normalises the given FilePath
.
normalise' :: FilePather (a -> FilePath)Source
A value using a constant function that normalises the given FilePath
.
makeValid :: FilePather FilePathSource
A value that makes valid the given FilePath
.
makeValid' :: FilePather (a -> FilePath)Source
A value using a constant function that makes valid the given FilePath
.
isRelative :: FilePather BoolSource
A value that produces a value denoting whether or not the given FilePath
has is relative.
isRelative' :: FilePather (a -> Bool)Source
A value using a constant function that produces a value denoting whether or not the given FilePath
has is relative.
isAbsolute :: FilePather BoolSource
A value that produces a value denoting whether or not the given FilePath
has is absolute.
isAbsolute' :: FilePather (a -> Bool)Source
A value using a constant function that produces a value denoting whether or not the given FilePath
has is absolute.
isValid :: FilePather BoolSource
A value that produces a value denoting whether or not the given FilePath
has is valid.
isValid' :: FilePather (a -> Bool)Source
A value using a constant function that produces a value denoting whether or not the given FilePath
has is valid.
Utility
(==||) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f BoolSource
Tests for equality of any
values in the given container.
(/=||) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f BoolSource
Tests for inequality of any
values in the given container.
(==&&) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f BoolSource
Tests for equality of all
values in the given container.
(/=&&) :: (Eq a, Functor f, Foldable t) => f a -> t a -> f BoolSource
Tests for inequality of all
values in the given container.
(==>) :: Applicative f => f Bool -> f Bool -> f BoolSource
Tests for implication in an applicative functor.
(===>) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)Source
Tests for implication in an applicative functor in an applicative functor.
(/=>) :: Applicative f => f Bool -> f Bool -> f BoolSource
Tests for inverse implication in an applicative functor.
(/==>) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)Source
Tests for inverse implication in an applicative functor in an applicative functor.
(&&?) :: Applicative f => f Bool -> f Bool -> f BoolSource
Performs conjunction (AND
) in an applicative functor.
(?&&?) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)Source
Performs conjunction (AND
) in an applicative functor in an applicative functor.
(||?) :: Applicative f => f Bool -> f Bool -> f BoolSource
Performs disjunction (OR
) in an applicative functor.
(?||?) :: (Applicative f1, Applicative f2) => f1 (f2 Bool) -> f1 (f2 Bool) -> f1 (f2 Bool)Source
Performs disjunction (OR
) in an applicative functor in an applicative functor.
Find predicates
The possible types of a file.
type RecursePredicate = FilePather BoolSource
A recurse predicate takes a FilePath
and returns whether or not to continue recursing on that file.
type FilterPredicate = FilePather (FileType -> Bool)Source
A filter predicate takes a FilePath
and a file type and returns whether or not to filter the value.
isFile :: Applicative f => f (FileType -> Bool)Source
Compares for equivalence to a File
in an applicative functor.
isDirectory :: Applicative f => f (FileType -> Bool)Source
Compares for equivalence to a Directory
in an applicative functor.
isUnknown :: Applicative f => f (FileType -> Bool)Source
Compares for equivalence to Unknown
in an applicative functor.
Core function
:: RecursePredicate | The recurse predicate determines whether to continue recursing on the given file path. |
-> FilterPredicate | The filter predicate determines whether to keep the current file path. |
-> FilePath | The file path to begin finding files. |
-> IO [FilePath] | All files found. |
Finds all files using the given recurse predicate and filter predicate in the given file path.