haskell-tools-refactor-0.7.0.0: Refactoring Tool for Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor.GetModules

Contents

Description

Representation and operations for module collections (libraries, executables, ...) in the framework.

Synopsis

Documentation

data ModuleCollection Source #

The modules of a library, executable, test or benchmark. A package contains one or more module collection.

Constructors

ModuleCollection 

Fields

lookupModuleColl :: String -> [ModuleCollection] -> Maybe ModuleCollection Source #

Find the module collection where the given module is.

getAllModules :: [FilePath] -> IO [ModuleCollection] Source #

Gets all ModuleCollections from a list of source directories. It also orders the source directories that are package roots so that they can be loaded in the order they are defined (no backward imports). This matters in those cases because for them there can be special compilation flags.

orderMCs :: [ModuleCollection] -> [ModuleCollection] Source #

Sorts model collection in an order to remove all backward references. Works because module collections defined by directories cannot be recursive.

getModules :: FilePath -> IO [ModuleCollection] Source #

Get modules of the project with the indicated root directory. If there is a cabal file, it uses that, otherwise it just scans the directory recursively for haskell sourcefiles. Only returns the non-boot haskell modules, the boot modules will be found during loading.

modulesFromDirectory :: FilePath -> FilePath -> IO [String] Source #

Load the module giving a directory. All modules loaded from the folder and subfolders.

modulesFromCabalFile :: FilePath -> FilePath -> IO [ModuleCollection] Source #

Load the module using a cabal file. The modules described in the cabal file will be loaded. The flags and extensions set in the cabal file will be used by default.

breaks :: [a] -> [(a, [a])] Source #

Not imported from DynFlags.hs, so I copied it here

Mapping of Cabal haskell extensions to their GHC counterpart

translateExtension :: KnownExtension -> Maybe Extension Source #

Map the cabal extensions to the ones that GHC recognizes