-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Functions on System.FilePath
--
-- Functions over System.FilePath including a find function for
-- recursing down directories.
@package FilePather
@version 0.1.4
module System.FilePath.FilePather.FileType
-- | The possible types of a file.
data FileType
-- | The type is a normal file.
File :: FileType
-- | The type is a directory.
Directory :: FileType
-- | The type is unknown.
Unknown :: FileType
isFileType :: FileType -> Bool
isDirectoryType :: FileType -> Bool
isUnknownType :: FileType -> Bool
instance Eq FileType
instance Show FileType
instance Enum FileType
module System.FilePath.FilePather.FilterPredicate
data FilterPredicateT f
-- | A filter predicate that does not require effects to compute its
-- result.
type FilterPredicate = FilterPredicateT Identity
-- | A filter predicate takes a FilePath and a file type and returns
-- whether or not to filter the value.
filterPredicateT :: (FilePath -> FileType -> f Bool) -> FilterPredicateT f
-- | Construct a filter predicate that does not require effects to compute
-- its result.
filterPredicate :: (FilePath -> FileType -> Bool) -> FilterPredicate
-- | A filter predicate takes a FilePath and returns whether or not
-- to filter the value.
filterPredicateT' :: (FilePath -> f Bool) -> FilterPredicateT f
-- | Construct a filter predicate that does not require effects to compute
-- its result.
filterPredicate' :: (FilePath -> Bool) -> FilterPredicate
-- | Extract the filter predicate function.
runFilterPredicateT :: FilterPredicateT f -> FilePath -> FileType -> f Bool
-- | Construct a filter predicate that does not require effects to compute
-- its result.
runFilterPredicate :: FilterPredicate -> FilePath -> FileType -> Bool
module System.FilePath.FilePather.RecursePredicate
-- | A recurse predicate takes a FilePath and returns whether or not
-- to continue recursing on that file.
data RecursePredicateT f
-- | A recurse predicate that does not require effects to compute its
-- result.
type RecursePredicate = RecursePredicateT Identity
-- | Construct a recurse predicate. The most general construction function.
recursePredicateT :: (FilePath -> f Bool) -> RecursePredicateT f
-- | Construct a recurse predicate that does not require effects to compute
-- its result.
recursePredicate :: (FilePath -> Bool) -> RecursePredicate
-- | Extract the recurse predicate function.
runRecursePredicateT :: RecursePredicateT f -> FilePath -> f Bool
-- | Extract the recurse predicate function that does not require effects
-- to compute its result.
runRecursePredicate :: RecursePredicate -> FilePath -> Bool
-- | Convert the recurse predicate to a filter predicate.
toFilterPredicate :: RecursePredicateT f -> FilterPredicateT f
module System.FilePath.FilePather.FilePathPredicate
-- | Functions that are common to predicates that work on FilePath
-- values.
class FilePathPredicate f where hasExtension = (.!.) notHasExtension notHasExtension = (.!.) hasExtension hasTrailingPathSeparator = (.!.) notHasTrailingPathSeparator notHasTrailingPathSeparator = (.!.) hasTrailingPathSeparator isRelative = (.!.) isNotRelative isNotRelative = (.!.) isRelative isAbsolute = (.!.) isNotAbsolute isNotAbsolute = (.!.) isAbsolute isValid = (.!.) isNotValid isNotValid = (.!.) isValid
always :: (FilePathPredicate f, Monad g) => f g
never :: (FilePathPredicate f, Monad g) => f g
(.&&.) :: (FilePathPredicate f, Monad g) => f g -> f g -> f g
(.||.) :: (FilePathPredicate f, Monad g) => f g -> f g -> f g
(.!.) :: (FilePathPredicate f, Monad g) => f g -> f g
extension :: (FilePathPredicate f, Monad g) => (FilePath -> Bool) -> f g
directory :: (FilePathPredicate f, Monad g) => (FilePath -> Bool) -> f g
hasExtension :: (FilePathPredicate f, Monad g) => f g
notHasExtension :: (FilePathPredicate f, Monad g) => f g
splitExtension :: (FilePathPredicate f, Monad g) => (String -> String -> Bool) -> f g
splitDirectories :: (FilePathPredicate f, Monad g) => ([FilePath] -> Bool) -> f g
hasTrailingPathSeparator :: (FilePathPredicate f, Monad g) => f g
notHasTrailingPathSeparator :: (FilePathPredicate f, Monad g) => f g
fileName :: (FilePathPredicate f, Monad g) => (FilePath -> Bool) -> f g
baseName :: (FilePathPredicate f, Monad g) => (FilePath -> Bool) -> f g
normalise :: (FilePathPredicate f, Monad g) => (FilePath -> Bool) -> f g
makeValid :: (FilePathPredicate f, Monad g) => (FilePath -> Bool) -> f g
isRelative :: (FilePathPredicate f, Monad g) => f g
isNotRelative :: (FilePathPredicate f, Monad g) => f g
isAbsolute :: (FilePathPredicate f, Monad g) => f g
isNotAbsolute :: (FilePathPredicate f, Monad g) => f g
isValid :: (FilePathPredicate f, Monad g) => f g
isNotValid :: (FilePathPredicate f, Monad g) => f g
instance FilePathPredicate FilterPredicateT
instance FilePathPredicate RecursePredicateT
module System.FilePath.FilePather.LiftI
-- | A type-class for lifting a value. This type-class probably belongs
-- elsewhere (pointers appreciated!).
class LiftI f a | f -> a
liftI :: (LiftI f a, Monad g) => g a -> f g
instance LiftI FilterPredicateT Bool
instance LiftI RecursePredicateT Bool
module System.FilePath.FilePather.Find
-- | Finds all files using the given recurse predicate and filter predicate
-- in the given file path.
class Find f where findHere f r = getCurrentDirectory >>= find f r
find :: Find f => FilterPredicateT f -> RecursePredicateT f -> FilePath -> IO [FilePath]
findHere :: Find f => FilterPredicateT f -> RecursePredicateT f -> IO [FilePath]
instance Comonad f => Find (IdentityT f)
instance Find IO
instance Find Identity
module System.FilePath.FilePather