Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Shake.ImportQuery

Contents

Description

Utilities to generate and query the import graph.

Synopsis

Documentation

data CachedGraph Source #

Constructors

CachedGraph 

Instances

Instances details
Show CachedGraph Source # 
Instance details

Defined in Shake.ImportQuery

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.

get :: (Ord k, Monoid a) => k -> Map k a -> a Source #

generate

cppInImports :: Set FilePath Source #

Hardcoded list of modules that use CPP to determine their imports. TODO duplicated with Shakefile.ccInImports.