-- 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. -- -- This package is similar to the filemanip package but without the -- unix and mtl dependencies. -- -- Usage example: -- --
--   findHere always (extensionEq hs) >>= mapM_ putStrLn
--   ./Setup.hs
--   .SystemFilePath/FilePather.hs
--   
@package FilePather @version 0.0.1 module System.FilePath.FilePather -- | A function that takes a FilePath and produces a value. data FilePather a () :: FilePather a -> FilePath -> a -- | Construct a FilePather from the given function filePather :: (FilePath -> a) -> FilePather a -- | A value that runs the identity function. filePath :: FilePather FilePath -- | A value that always produces the value True. always :: FilePather Bool -- | A value using a constant function that produces the value True. always' :: FilePather (a -> Bool) -- | A value that always produces the value False. never :: FilePather Bool -- | A value that always produces a constant function that produces the -- value False. never' :: FilePather (a -> Bool) -- | A value that produces the extension of the given FilePath. extension :: FilePather FilePath -- | A value using a constant function that produces the extension of the -- given FilePath. extension' :: FilePather (a -> FilePath) -- | A value that produces the directory of the given FilePath. directory :: FilePather FilePath -- | A value using a constant function that produces the directory of the -- given FilePath. directory' :: FilePather (a -> FilePath) -- | A value that produces a value denoting whether or not the given -- FilePath has an extension. hasExtension :: FilePather Bool -- | A value using a constant function that produces a value denoting -- whether or not the given FilePath has an extension. hasExtension' :: FilePather (a -> Bool) -- | A value that produces a value splitting the given FilePath by -- its extension. splitExtension :: FilePather (String, String) -- | A value using a constant function that produces a value splitting the -- given FilePath by its extension. splitExtension' :: FilePather (a -> (String, String)) -- | A value that produces a value splitting the given FilePath into -- its directories. splitDirectories :: FilePather [FilePath] -- | A value using a constant function that produces a value splitting the -- given FilePath into its directories. splitDirectories' :: FilePather (a -> [FilePath]) -- | A value that produces a value denoting whether or not the given -- FilePath has a trailing path separator. hasTrailingPathSeparator :: FilePather Bool -- | A value using a constant function that produces a value denoting -- whether or not the given FilePath has a trailing path -- separator. hasTrailingPathSeparator' :: FilePather (a -> Bool) -- | A value that produces the file name of the given FilePath. fileName :: FilePather FilePath -- | A value using a constant function that produces the file name of the -- given FilePath. fileName' :: FilePather (a -> FilePath) -- | A value that produces the base name of the given FilePath. baseName :: FilePather FilePath -- | A value using a constant function that produces the base name of the -- given FilePath. baseName' :: FilePather (a -> FilePath) -- | A value that normalises the given FilePath. normalise :: FilePather FilePath -- | A value using a constant function that normalises the given -- FilePath. normalise' :: FilePather (a -> FilePath) -- | A value that makes valid the given FilePath. makeValid :: FilePather FilePath -- | A value using a constant function that makes valid the given -- FilePath. makeValid' :: FilePather (a -> FilePath) -- | A value that produces a value denoting whether or not the given -- FilePath has is relative. isRelative :: FilePather Bool -- | A value using a constant function that produces a value denoting -- whether or not the given FilePath has is relative. isRelative' :: FilePather (a -> Bool) -- | A value that produces a value denoting whether or not the given -- FilePath has is absolute. isAbsolute :: FilePather Bool -- | A value using a constant function that produces a value denoting -- whether or not the given FilePath has is absolute. isAbsolute' :: FilePather (a -> Bool) -- | A value that produces a value denoting whether or not the given -- FilePath has is valid. isValid :: FilePather Bool -- | A value using a constant function that produces a value denoting -- whether or not the given FilePath has is valid. isValid' :: FilePather (a -> Bool) -- | 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 -- | A recurse predicate takes a FilePath and returns whether or not -- to continue recursing on that file. type RecursePredicate = FilePather Bool -- | A filter predicate takes a FilePath and a file type and returns -- whether or not to filter the value. type FilterPredicate = FilePather (FileType -> Bool) -- | Compares for equivalence to a File in an applicative functor. isFile :: Applicative f => f (FileType -> Bool) -- | Compares for equivalence to a Directory in an applicative -- functor. isDirectory :: Applicative f => f (FileType -> Bool) -- | Compares for equivalence to Unknown in an applicative functor. isUnknown :: Applicative f => f (FileType -> Bool) -- | Finds all files using the given recurse predicate and filter predicate -- in the given file path. find :: RecursePredicate -> FilterPredicate -> FilePath -> IO [FilePath] -- | Returns a filter predicate based on whether a file extension satisfies -- a predicate. extensionSatisfies :: (FilePath -> Bool) -> FilterPredicate -- | Returns a filter predicate based on whether a file extension is one of -- the given list of extensions. extensionOneOf :: [FilePath] -> FilterPredicate -- | Returns a filter predicate based on whether a file extension equals -- the given extension. extensionEq :: FilePath -> FilterPredicate -- | Find in the current directory. findHere :: RecursePredicate -> FilterPredicate -> IO [FilePath] instance Eq FileType instance Show FileType instance Monoid a => Monoid (FilePather a) instance Monad FilePather instance Applicative FilePather instance Functor FilePather