importify-1.0: Tool for haskell imports refactoring

Safe HaskellNone
LanguageHaskell2010

Importify.Cabal.Target

Contents

Description

Functions to retrieve and store mapping from modules to their targets and extensions.

Synopsis

Maps from modules paths to cache parts

type ModulesMap = HashMap FilePath ModulesBundle Source #

Mapping from module path to its package and module name.

Target types

data ModulesBundle Source #

All data for given module. This is needed to locate all required information about module by its path.

Constructors

ModulesBundle 

Fields

data TargetId Source #

Instances

Eq TargetId Source # 
Show TargetId Source # 
Generic TargetId Source # 

Associated Types

type Rep TargetId :: * -> * #

Methods

from :: TargetId -> Rep TargetId x #

to :: Rep TargetId x -> TargetId #

Hashable TargetId Source # 

Methods

hashWithSalt :: Int -> TargetId -> Int #

hash :: TargetId -> Int #

ToJSON TargetId Source # 
ToJSONKey TargetId Source # 
FromJSON TargetId Source # 
FromJSONKey TargetId Source # 
type Rep TargetId Source # 

Utilities to extract targets

extractTargetsMap :: Path Abs Dir -> GenericPackageDescription -> IO TargetsMap Source #

This function extracts ModulesMap from given package by given full path to project root directory.

packageExtensions :: [TargetId] -> GenericPackageDescription -> ExtensionsMap Source #

Extracts mapping from each package target to its extensions enabled by default.

packageTargets :: GenericPackageDescription -> [TargetId] Source #

Extract every TargetId for given project description.

targetIdDir :: TargetId -> Text Source #

Directory name for corresponding target.