importify-1.0: Tool for haskell imports refactoring

Safe HaskellNone
LanguageHaskell2010

Importify.Stack

Description

Utilities which allows to use stack tools for different dependencies stuff.

Synopsis

Documentation

data QueryPackage Source #

This data type represents package returned by stack query command.

Constructors

QueryPackage 

Fields

ghcIncludePath :: MaybeT IO (Path Abs Dir) Source #

This function finds path to directory where include for ghc lies. Filepath looks like this: ~.stackprogramsx86_64-linuxghc-8.0.2libghc-8.0.2/include This function needed to tell dependencies about files like "MachDeps.h".

TODO: use GHC path from project?

pkgName :: QueryPackage -> Text Source #

Show full name of QueryPackage with version.

stackListDependencies :: MonadIO m => m (HashMap Text Text) Source #

Extract all dependencies with versions using stack list-dependencies shell command.

stackListPackages :: forall m. (MonadIO m, MonadCatch m) => m (LocalPackages, RemotePackages) Source #

Queries list of all local packages for project. If some errors occur then warning is printed into console and empty list returned.

stackProjectRoot :: MaybeT IO (Path Abs Dir) Source #

Acquires project using stack path --project-root command.

upgradeWithVersions :: HashMap Text Text -> [Text] -> [Text] Source #

Takes mapping from package names to their versions and list of packages adding version to each package which is inside dictionary.