Safe Haskell | Safe-Inferred |
---|
Synopsis
- data Generated = Generated {}
- importsOf :: Generated -> Maybe.Maybe [String] -> IO.FilePath -> Shake.Action [IO.FilePath]
- transitiveImportsOf :: Generated -> (IO.FilePath -> Maybe.Maybe [String]) -> IO.FilePath -> Shake.Action [IO.FilePath]
- importsOfIO :: Generated -> Maybe.Maybe [String] -> IO.FilePath -> IO.IO [IO.FilePath]
- importsPackagagesOf_ :: PackageDb -> Generated -> Maybe.Maybe [String] -> IO.FilePath -> IO.IO ([IO.FilePath], [Package])
- loadPackageDb :: IO.FilePath -> Shake.Action PackageDb
- savePackageDb :: [Package] -> IO.FilePath -> IO.IO ()
Documentation
Normally importsOf
and transitiveImportsOf
filter out files that don't
exist, under the assumption that they belong to external packages. This
set contains exceptions to that, so they will get a need call, so they can
be generated.
Generated | |
|
importsOf :: Generated -> Maybe.Maybe [String] -> IO.FilePath -> Shake.Action [IO.FilePath] Source #
Find files of modules this module imports, in the form AB.hs or AB.hsc. Paths that don't exist are assumed to be package imports and are omitted.
transitiveImportsOf :: Generated -> (IO.FilePath -> Maybe.Maybe [String]) -> IO.FilePath -> Shake.Action [IO.FilePath] Source #
Like importsOf
but transitive. Includes the given module.
TODO Technically I should run CPP on the output of hsc2hs, which means
this should map the module names to the appropriate .hs and need
it.
Otherwise the '#include' that belongs to hsc2hs will get processed by CPP.
:: Generated | |
-> Maybe.Maybe [String] | If Just, first run CPP with these flags. |
-> IO.FilePath | |
-> IO.IO [IO.FilePath] |
:: PackageDb | |
-> Generated | |
-> Maybe.Maybe [String] | If Just, first run CPP with these flags. |
-> IO.FilePath | |
-> IO.IO ([IO.FilePath], [Package]) |
Get local imports and package dependencies.
I thought I wound use this but wound up not wanting it. But I'll leave the
basic implementation here in case I change my mind. This still needs to
be integrated with importsOf
and transitiveImportsOf
.
loadPackageDb :: IO.FilePath -> Shake.Action PackageDb Source #
Load cached module to package db.
savePackageDb :: [Package] -> IO.FilePath -> IO.IO () Source #
Call getModuleToPackage
and save its contents to the file.
If there are colliding modules, throw an IO exception.