prune-juice-0.4: Prune unused Haskell dependencies
Safe HaskellNone
LanguageHaskell2010

Data.Prune.ImportParser

Description

Utilities for parsing imports from Haskell source files.

Synopsis

Documentation

parseFileImports :: FilePath -> IO (Set ModuleName) Source #

Parse a Haskell source file's imports.

parseDependencyName :: String -> IO DependencyName Source #

Parse name from the `ghc-pkg` field description.

parseExposedModules :: String -> IO (Set ModuleName) Source #

Parse exposed modules from the `ghc-pkg` field description.

getUsedDependencies :: Map ModuleName DependencyName -> Set ModuleName -> Set DependencyName Source #

Get the dependencies used by a list of modules imported by a Haskell source file.

getCompilableUsedDependencies :: Map ModuleName DependencyName -> Compilable -> IO (Set DependencyName) Source #

Get the dependencies used by a thing to compile by (1) parsing each source file's imports, (2) getting the dependencies each of those files use, and (3) smooshing all the dependencies together to return.