Safe Haskell | Safe-Inferred |
---|
Utilities to generate and query the import graph.
Synopsis
- type Graph = Map Module [Module]
- type Module = Text
- data CachedGraph = CachedGraph {}
- cachedGraph :: Graph -> CachedGraph
- loadCachedGraph :: IO CachedGraph
- addDep :: Graph -> Module -> Module -> Either [[Module]] (Tree.Tree Module)
- rmDep :: CachedGraph -> Module -> Module -> [(Module, Set Module)]
- findWeakLinks :: CachedGraph -> [(Int, ((Text, Text), [(Module, Set Module)]))]
- paths :: Graph -> Module -> Module -> [[Module]]
- closureTree :: Graph -> Module -> Tree.Tree Module
- trimTree :: Set Module -> Tree.Tree Module -> Tree.Tree Module
- closureList :: Graph -> Module -> [Module]
- closure :: Graph -> Module -> Set Module
- importsOf :: Module -> Graph -> [Module]
- get :: (Ord k, Monoid a) => k -> Map k a -> a
- cacheGraph :: IO ()
- loadGraph :: IO Graph
- cacheFile :: FilePath
- generateGraph :: IO Graph
- getAllHs :: IO [FilePath]
- generatedSrc :: HsDeps.Generated
- cppFlags :: FilePath -> Maybe.Maybe [String]
- fileToModule :: FilePath -> Module
- cppInImports :: Set FilePath
Documentation
data CachedGraph Source #
Instances
Show CachedGraph Source # | |
Defined in Shake.ImportQuery showsPrec :: Int -> CachedGraph -> ShowS # show :: CachedGraph -> String # showList :: [CachedGraph] -> ShowS # |
cachedGraph :: Graph -> CachedGraph Source #
addDep :: Graph -> Module -> Module -> Either [[Module]] (Tree.Tree Module) Source #
If I add some import, what do I now depend on that I didn't before?
It's the new closure minus the previous one. If I already imported that module, it's Left and the paths that show I already depend. If I didn't, I added it, plus whatever non-zero adds it implies. TODO If it's circular, report that!
rmDep :: CachedGraph -> Module -> Module -> [(Module, Set Module)] Source #
If I remove Perform.Signal from Derive.ScoreT, who now has fewer deps?
findWeakLinks :: CachedGraph -> [(Int, ((Text, Text), [(Module, Set Module)]))] Source #
This implements the brute-force way of seeing which single imports can be removed for the greatest reduction in dependencies.
closureList :: Graph -> Module -> [Module] Source #
Closure as a list so you can abort as soon as you find something.
generate
cacheGraph :: IO () Source #
generateGraph :: IO Graph Source #
fileToModule :: FilePath -> Module Source #
cppInImports :: Set FilePath Source #
Hardcoded list of modules that use CPP to determine their imports. TODO duplicated with Shakefile.ccInImports.