cabal-install-3.10.2.1: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Client.Init.Utils

Synopsis

- data SourceFileEntry = SourceFileEntry {
  - relativeSourcePath :: FilePath
  - moduleName :: ModuleName
  - fileExtension :: String
  - imports :: [ModuleName]
  - extensions :: [Extension]
  }
- retrieveSourceFiles :: Interactive m => FilePath -> m [SourceFileEntry]
- retrieveModuleName :: Interactive m => FilePath -> m (Maybe ModuleName)
- retrieveModuleImports :: Interactive m => FilePath -> m [ModuleName]
- retrieveModuleExtensions :: Interactive m => FilePath -> m [Extension]
- retrieveBuildTools :: Interactive m => CabalSpecVersion -> FilePath -> m [Dependency]
- retrieveDependencies :: Interactive m => Verbosity -> InitFlags -> [(ModuleName, ModuleName)] -> InstalledPackageIndex -> m [Dependency]
- isMain :: String -> Bool
- isHaskell :: String -> Bool
- isSourceFile :: Maybe [FilePath] -> SourceFileEntry -> Bool
- trim :: String -> String
- currentDirPkgName :: Interactive m => m PackageName
- filePathToPkgName :: Interactive m => FilePath -> m PackageName
- mkPackageNameDep :: PackageName -> Dependency
- fixupDocFiles :: Interactive m => Verbosity -> PkgDescription -> m PkgDescription
- mkStringyDep :: String -> Dependency
- getBaseDep :: Interactive m => InstalledPackageIndex -> InitFlags -> m [Dependency]
- addLibDepToExe :: PackageName -> ExeTarget -> ExeTarget
- addLibDepToTest :: PackageName -> Maybe TestTarget -> Maybe TestTarget

# Documentation

data SourceFileEntry #

Data type of source files found in the working directory

Constructors

SourceFileEntry |
Fields relativeSourcePath :: FilePath moduleName :: ModuleName fileExtension :: String imports :: [ModuleName] extensions :: [Extension]

#### Instances

Instances details

Show SourceFileEntry # |
Instance details Defined in Distribution.Client.Init.Utils Methods showsPrec :: Int -> SourceFileEntry -> ShowS # show :: SourceFileEntry -> String # showList :: [SourceFileEntry] -> ShowS #

retrieveSourceFiles :: Interactive m => FilePath -> m [SourceFileEntry] #

retrieveModuleName :: Interactive m => FilePath -> m (Maybe ModuleName) #

Given a module, retrieve its name

retrieveModuleImports :: Interactive m => FilePath -> m [ModuleName] #

Given a module, retrieve all of its imports

retrieveModuleExtensions :: Interactive m => FilePath -> m [Extension] #

Given a module, retrieve all of its language pragmas

retrieveBuildTools :: Interactive m => CabalSpecVersion -> FilePath -> m [Dependency] #

retrieveDependencies :: Interactive m => Verbosity -> InitFlags -> [(ModuleName, ModuleName)] -> InstalledPackageIndex -> m [Dependency] #

isMain :: String -> Bool #

Check if a given file has main file characteristics

isHaskell :: String -> Bool #

Check if a given file has a Haskell extension

isSourceFile :: Maybe [FilePath] -> SourceFileEntry -> Bool #

Check whether a potential source file is located in one of the source directories.

trim :: String -> String #

currentDirPkgName :: Interactive m => m PackageName #

filePathToPkgName :: Interactive m => FilePath -> m PackageName #

mkPackageNameDep :: PackageName -> Dependency #

fixupDocFiles :: Interactive m => Verbosity -> PkgDescription -> m PkgDescription #

mkStringyDep :: String -> Dependency #

getBaseDep :: Interactive m => InstalledPackageIndex -> InitFlags -> m [Dependency] #

addLibDepToExe :: PackageName -> ExeTarget -> ExeTarget #

addLibDepToTest :: PackageName -> Maybe TestTarget -> Maybe TestTarget #