Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
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.