Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type DirPath = FilePath
- type FileName = String
- findCabalFile :: FilePath -> IO (Maybe FilePath)
- findStackConfigFile :: FilePath -> IO (Maybe FilePath)
- findCabalSandboxDir :: FilePath -> IO (Maybe FilePath)
- findCustomPackageDbFile :: FilePath -> IO (Maybe FilePath)
- getSandboxDb :: Cradle -> IO (Maybe GhcPkgDb)
- extractSandboxDbDir :: String -> Maybe FilePath
- isCabalFile :: FilePath -> Bool
- takeExtension' :: FilePath -> String
- findFileInParentsP :: (FilePath -> Bool) -> ([FilePath] -> Maybe a) -> FilePath -> IO (Maybe a)
- findFilesInParentsP :: (FilePath -> Bool) -> FilePath -> IO [IO [FilePath]]
- getFilesP :: (FilePath -> Bool) -> DirPath -> IO [FileName]
- parents :: FilePath -> [FilePath]
- setupConfigFile :: Cradle -> FilePath
- sandboxConfigFile :: Cradle -> FilePath
- sandboxConfigFileName :: String
- setupConfigPath :: FilePath -> FilePath
- macrosHeaderPath :: FilePath
- autogenModulePath :: String -> String
- autogenModulesDir :: FilePath
- ghcSandboxPkgDbDir :: String -> String
- packageCache :: String
- symbolCache :: Cradle -> FilePath
- symbolCacheFile :: String
- resolvedComponentsCacheFile :: FilePath -> FilePath
- cabalHelperCacheFile :: FilePath -> FilePath
- mergedPkgOptsCacheFile :: FilePath -> FilePath
- pkgDbStackCacheFile :: FilePath -> FilePath
- module GhcMod.Caching
Documentation
findCabalFile :: FilePath -> IO (Maybe FilePath) Source #
findCabalFiles dir
. Searches for a .cabal
files in dir
's parent
directories. The first parent directory containing more than one cabal file
is assumed to be the project directory. If only one cabal file exists in this
directory it is returned otherwise findCabalFiles
throws GMENoCabalFile
or GMETooManyCabalFiles
extractSandboxDbDir :: String -> Maybe FilePath Source #
Extract the sandbox package db directory from the cabal.sandbox.config file. Exception is thrown if the sandbox config file is broken.
isCabalFile :: FilePath -> Bool Source #
>>>
isCabalFile "/home/user/.cabal"
False
takeExtension' :: FilePath -> String Source #
>>>
takeExtension' "/some/dir/bla.cabal"
".cabal"
>>>
takeExtension' "some/reldir/bla.cabal"
".cabal"
>>>
takeExtension' "bla.cabal"
".cabal"
>>>
takeExtension' ".cabal"
""
findFileInParentsP :: (FilePath -> Bool) -> ([FilePath] -> Maybe a) -> FilePath -> IO (Maybe a) Source #
findFileInParentsP p r dir
Look for files satisfying p
in dir
and all
it's parent directories. Files found to satisfy p
in a given directory are
passed to r
and if this yields a Just
value the search finishes early
without examinig any more directories and this value is returned.
findFilesInParentsP :: (FilePath -> Bool) -> FilePath -> IO [IO [FilePath]] Source #
findFilesInParentsP p dir
Look for files satisfying p
in dir
and all
it's parent directories.
getFilesP :: (FilePath -> Bool) -> DirPath -> IO [FileName] Source #
getFilesP p dir
. Find all files satisfying p
in .cabal
in dir
.
parents :: FilePath -> [FilePath] Source #
parents dir
. Returns all parent directories of dir
including dir
.
Examples
>>>
parents "foo"
["foo"]
>>>
parents "/foo"
["/foo","/"]
>>>
parents "/foo/bar"
["/foo/bar","/foo","/"]
>>>
parents "foo/bar"
["foo/bar","foo"]
setupConfigFile :: Cradle -> FilePath Source #
sandboxConfigFile :: Cradle -> FilePath Source #
setupConfigPath :: FilePath -> FilePath Source #
Path to LocalBuildInfo
file, usually dist/setup-config
autogenModulePath :: String -> String Source #
ghcSandboxPkgDbDir :: String -> String Source #
symbolCache :: Cradle -> FilePath Source #
Filename of the symbol table cache file.
module GhcMod.Caching