Distribution.Client.Init.NonInteractive.Heuristics

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

Copyright | (c) Benedikt Huber 2009
License | BSD-like
Maintainer | cabal-devel@haskell.org
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Client.Init.NonInteractive.Heuristics

Description

Heuristics for creating initial cabal files.

Synopsis

- guessPackageName :: Interactive m => FilePath -> m PackageName
- guessMainFile :: Interactive m => FilePath -> m HsFilePath
- guessLicense :: Interactive m => InitFlags -> m SpecLicense
- guessExtraDocFiles :: Interactive m => InitFlags -> m (Maybe (Set FilePath))
- guessAuthorName :: Interactive m => m (Maybe String)
- guessAuthorEmail :: Interactive m => m (Maybe String)
- guessCabalSpecVersion :: Interactive m => m CabalSpecVersion
- guessLanguage :: Interactive m => Compiler -> m Language
- guessPackageType :: Interactive m => InitFlags -> m PackageType
- guessSourceDirectories :: Interactive m => InitFlags -> m [FilePath]
- guessApplicationDirectories :: Interactive m => InitFlags -> m [FilePath]

# Documentation

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

Guess the package name based on the given root directory.

guessMainFile :: Interactive m => FilePath -> m HsFilePath #

Guess the main file, returns a default value if none is found.

guessLicense :: Interactive m => InitFlags -> m SpecLicense #

Try to guess the license from an already existing `LICENSE` file in the package directory, comparing the file contents with the ones listed in `Licenses.hs`, for now it only returns a default value.

guessExtraDocFiles :: Interactive m => InitFlags -> m (Maybe (Set FilePath)) #

guessAuthorName :: Interactive m => m (Maybe String) #

Guess author and email using git configuration options.

guessAuthorEmail :: Interactive m => m (Maybe String) #

guessCabalSpecVersion :: Interactive m => m CabalSpecVersion #

Juggling characters around to guess the desired cabal version based on the system's cabal version.

guessLanguage :: Interactive m => Compiler -> m Language #

Guess the language specification based on the GHC version

guessPackageType :: Interactive m => InitFlags -> m PackageType #

Try to guess the package type from the files in the package directory, looking for unique characteristics from each type, defaults to Executable.

guessSourceDirectories :: Interactive m => InitFlags -> m [FilePath] #

Try to guess the source directories, using a default value as fallback.

guessApplicationDirectories :: Interactive m => InitFlags -> m [FilePath] #

Try to guess the application directories from the package directory, using a default value as fallback.