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

Data.Prune.ImportParser

Description

Utilities for parsing imports from Haskell source files.

Synopsis

Documentation

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

Parse a Haskell source file's imports.

parseDependencyName :: String -> Either String (Maybe DependencyName) Source #

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

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

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

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

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

getCompilableUsedDependencies :: (MonadIO m, MonadLogger m) => Map ModuleName (Set DependencyName) -> Compilable -> m (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.