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

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

Distribution.Client.Init.Types

Contents

- Data
  - Targets and descriptions
  - package types
  - Main file
- Typeclasses
- Aliases
- File creator opts
- Formatters
- Other conveniences

Description

Some types used by the 'cabal init' command.

Synopsis

- data InitFlags = InitFlags {
  - interactive :: Flag Bool
  - quiet :: Flag Bool
  - packageDir :: Flag FilePath
  - noComments :: Flag Bool
  - minimal :: Flag Bool
  - simpleProject :: Flag Bool
  - packageName :: Flag PackageName
  - version :: Flag Version
  - cabalVersion :: Flag CabalSpecVersion
  - license :: Flag SpecLicense
  - author :: Flag String
  - email :: Flag String
  - homepage :: Flag String
  - synopsis :: Flag String
  - category :: Flag String
  - extraSrc :: Flag [String]
  - extraDoc :: Flag [String]
  - packageType :: Flag PackageType
  - mainIs :: Flag FilePath
  - language :: Flag Language
  - exposedModules :: Flag [ModuleName]
  - otherModules :: Flag [ModuleName]
  - otherExts :: Flag [Extension]
  - dependencies :: Flag [Dependency]
  - applicationDirs :: Flag [String]
  - sourceDirs :: Flag [String]
  - buildTools :: Flag [String]
  - initializeTestSuite :: Flag Bool
  - testDirs :: Flag [String]
  - initHcPath :: Flag FilePath
  - initVerbosity :: Flag Verbosity
  - overwrite :: Flag Bool
  }
- data PkgDescription = PkgDescription {
  - _pkgCabalVersion :: CabalSpecVersion
  - _pkgName :: PackageName
  - _pkgVersion :: Version
  - _pkgLicense :: SpecLicense
  - _pkgAuthor :: String
  - _pkgEmail :: String
  - _pkgHomePage :: String
  - _pkgSynopsis :: String
  - _pkgCategory :: String
  - _pkgExtraSrcFiles :: Set String
  - _pkgExtraDocFiles :: Maybe (Set String)
  }
- data LibTarget = LibTarget {
  - _libSourceDirs :: [String]
  - _libLanguage :: Language
  - _libExposedModules :: NonEmpty ModuleName
  - _libOtherModules :: [ModuleName]
  - _libOtherExts :: [Extension]
  - _libDependencies :: [Dependency]
  - _libBuildTools :: [Dependency]
  }
- data ExeTarget = ExeTarget {
  - _exeMainIs :: HsFilePath
  - _exeApplicationDirs :: [String]
  - _exeLanguage :: Language
  - _exeOtherModules :: [ModuleName]
  - _exeOtherExts :: [Extension]
  - _exeDependencies :: [Dependency]
  - _exeBuildTools :: [Dependency]
  }
- data TestTarget = TestTarget {
  - _testMainIs :: HsFilePath
  - _testDirs :: [String]
  - _testLanguage :: Language
  - _testOtherModules :: [ModuleName]
  - _testOtherExts :: [Extension]
  - _testDependencies :: [Dependency]
  - _testBuildTools :: [Dependency]
  }
- data PackageType
  - = Library
  - | Executable
  - | LibraryAndExecutable
  - | TestSuite
- data HsFilePath = HsFilePath {
  - _hsFilePath :: FilePath
  - _hsFileType :: HsFileType
  }
- data HsFileType
  - = Literate
  - | Standard
  - | InvalidHsPath
- fromHsFilePath :: HsFilePath -> Maybe FilePath
- toHsFilePath :: FilePath -> HsFilePath
- toLiterateHs :: HsFilePath -> HsFilePath
- toStandardHs :: HsFilePath -> HsFilePath
- mkLiterate :: HsFilePath -> [String] -> [String]
- isHsFilePath :: FilePath -> Bool
- class Monad m => Interactive (m :: Type -> Type) where
  - getLine :: m String
  - readFile :: FilePath -> m String
  - getCurrentDirectory :: m FilePath
  - getHomeDirectory :: m FilePath
  - getDirectoryContents :: FilePath -> m [FilePath]
  - listDirectory :: FilePath -> m [FilePath]
  - doesDirectoryExist :: FilePath -> m Bool
  - doesFileExist :: FilePath -> m Bool
  - canonicalizePathNoThrow :: FilePath -> m FilePath
  - readProcessWithExitCode :: FilePath -> [String] -> String -> m (ExitCode, String, String)
  - getEnvironment :: m [(String, String)]
  - getCurrentYear :: m Integer
  - listFilesInside :: (FilePath -> m Bool) -> FilePath -> m [FilePath]
  - listFilesRecursive :: FilePath -> m [FilePath]
  - putStr :: String -> m ()
  - putStrLn :: String -> m ()
  - createDirectory :: FilePath -> m ()
  - removeDirectory :: FilePath -> m ()
  - writeFile :: FilePath -> String -> m ()
  - removeExistingFile :: FilePath -> m ()
  - copyFile :: FilePath -> FilePath -> m ()
  - renameDirectory :: FilePath -> FilePath -> m ()
  - hFlush :: Handle -> m ()
  - message :: Verbosity -> Severity -> String -> m ()
  - break :: m Bool
  - throwPrompt :: BreakException -> m a
- newtype BreakException = BreakException String
- newtype PurePrompt a = PurePrompt {
  - _runPrompt :: NonEmpty String -> Either BreakException (a, NonEmpty String)
  }
- evalPrompt :: PurePrompt a -> NonEmpty String -> a
- data Severity
  - = Log
  - | Info
  - | Warning
  - | Error
- type IsLiterate = Bool
- type IsSimple = Bool
- data WriteOpts = WriteOpts {
  - _optOverwrite :: Bool
  - _optMinimal :: Bool
  - _optNoComments :: Bool
  - _optVerbosity :: Verbosity
  - _optPkgDir :: FilePath
  - _optPkgType :: PackageType
  - _optPkgName :: PackageName
  - _optCabalSpec :: CabalSpecVersion
  }
- data ProjectSettings = ProjectSettings {
  - _pkgOpts :: WriteOpts
  - _pkgDesc :: PkgDescription
  - _pkgLibTarget :: Maybe LibTarget
  - _pkgExeTarget :: Maybe ExeTarget
  - _pkgTestTarget :: Maybe TestTarget
  }
- data FieldAnnotation = FieldAnnotation {
  - annCommentedOut :: Bool
  - annCommentLines :: CommentPosition
  }
- data DefaultPrompt t
  - = DefaultPrompt t
  - | OptionalPrompt
  - | MandatoryPrompt

# Data

data InitFlags #

InitFlags is a subset of flags available in the `.cabal` file that represent options that are relevant to the init command process.

Constructors

InitFlags |

Fields

- interactive :: Flag Bool
- quiet :: Flag Bool
- packageDir :: Flag FilePath
- noComments :: Flag Bool
- minimal :: Flag Bool
- simpleProject :: Flag Bool
- packageName :: Flag PackageName
- version :: Flag Version
- cabalVersion :: Flag CabalSpecVersion
- license :: Flag SpecLicense
- author :: Flag String
- email :: Flag String
- homepage :: Flag String
- synopsis :: Flag String
- category :: Flag String
- extraSrc :: Flag [String]
- extraDoc :: Flag [String]
- packageType :: Flag PackageType
- mainIs :: Flag FilePath
- language :: Flag Language
- exposedModules :: Flag [ModuleName]
- otherModules :: Flag [ModuleName]
- otherExts :: Flag [Extension]
- dependencies :: Flag [Dependency]
- applicationDirs :: Flag [String]
- sourceDirs :: Flag [String]
- buildTools :: Flag [String]
- initializeTestSuite :: Flag Bool
- testDirs :: Flag [String]
- initHcPath :: Flag FilePath
- initVerbosity :: Flag Verbosity
- overwrite :: Flag Bool

#### Instances

Instances details

Monoid InitFlags # |
Instance details Defined in Distribution.Client.Init.Types Methods mempty :: InitFlags # mappend :: InitFlags -> InitFlags -> InitFlags # mconcat :: [InitFlags] -> InitFlags #
Semigroup InitFlags # |
Instance details Defined in Distribution.Client.Init.Types Methods (<>) :: InitFlags -> InitFlags -> InitFlags # sconcat :: NonEmpty InitFlags -> InitFlags # stimes :: Integral b => b -> InitFlags -> InitFlags #
Generic InitFlags # |

Instance details

Defined in Distribution.Client.Init.Types

Associated Types

type Rep InitFlags |

Instance details

Defined in Distribution.Client.Init.Types

type Rep InitFlags = D1 ('MetaData "InitFlags" "Distribution.Client.Init.Types" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "InitFlags" 'PrefixI 'True) (((((S1 ('MetaSel ('Just "interactive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "quiet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))) :*: (S1 ('MetaSel ('Just "packageDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "noComments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)))) :*: ((S1 ('MetaSel ('Just "minimal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "simpleProject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))) :*: (S1 ('MetaSel ('Just "packageName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag PackageName)) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Version))))) :*: (((S1 ('MetaSel ('Just "cabalVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag CabalSpecVersion)) :*: S1 ('MetaSel ('Just "license") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag SpecLicense))) :*: (S1 ('MetaSel ('Just "author") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "email") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)))) :*: ((S1 ('MetaSel ('Just "homepage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "synopsis") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String))) :*: (S1 ('MetaSel ('Just "category") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "extraSrc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])))))) :*: ((((S1 ('MetaSel ('Just "extraDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "packageType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag PackageType))) :*: (S1 ('MetaSel ('Just "mainIs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "language") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Language)))) :*: ((S1 ('MetaSel ('Just "exposedModules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [ModuleName])) :*: S1 ('MetaSel ('Just "otherModules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [ModuleName]))) :*: (S1 ('MetaSel ('Just "otherExts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [Extension])) :*: S1 ('MetaSel ('Just "dependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [Dependency]))))) :*: (((S1 ('MetaSel ('Just "applicationDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "sourceDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String]))) :*: (S1 ('MetaSel ('Just "buildTools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "initializeTestSuite") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)))) :*: ((S1 ('MetaSel ('Just "testDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "initHcPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath))) :*: (S1 ('MetaSel ('Just "initVerbosity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Verbosity)) :*: S1 ('MetaSel ('Just "overwrite") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))))))))

Methods

from :: InitFlags -> Rep InitFlags x #

to :: Rep InitFlags x -> InitFlags #

Show InitFlags # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> InitFlags -> ShowS # show :: InitFlags -> String # showList :: [InitFlags] -> ShowS #
Eq InitFlags # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: InitFlags -> InitFlags -> Bool # (/=) :: InitFlags -> InitFlags -> Bool #
type Rep InitFlags # |

Instance details

Defined in Distribution.Client.Init.Types

type Rep InitFlags = D1 ('MetaData "InitFlags" "Distribution.Client.Init.Types" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "InitFlags" 'PrefixI 'True) (((((S1 ('MetaSel ('Just "interactive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "quiet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))) :*: (S1 ('MetaSel ('Just "packageDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "noComments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)))) :*: ((S1 ('MetaSel ('Just "minimal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "simpleProject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))) :*: (S1 ('MetaSel ('Just "packageName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag PackageName)) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Version))))) :*: (((S1 ('MetaSel ('Just "cabalVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag CabalSpecVersion)) :*: S1 ('MetaSel ('Just "license") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag SpecLicense))) :*: (S1 ('MetaSel ('Just "author") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "email") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)))) :*: ((S1 ('MetaSel ('Just "homepage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "synopsis") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String))) :*: (S1 ('MetaSel ('Just "category") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "extraSrc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])))))) :*: ((((S1 ('MetaSel ('Just "extraDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "packageType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag PackageType))) :*: (S1 ('MetaSel ('Just "mainIs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "language") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Language)))) :*: ((S1 ('MetaSel ('Just "exposedModules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [ModuleName])) :*: S1 ('MetaSel ('Just "otherModules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [ModuleName]))) :*: (S1 ('MetaSel ('Just "otherExts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [Extension])) :*: S1 ('MetaSel ('Just "dependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [Dependency]))))) :*: (((S1 ('MetaSel ('Just "applicationDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "sourceDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String]))) :*: (S1 ('MetaSel ('Just "buildTools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "initializeTestSuite") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)))) :*: ((S1 ('MetaSel ('Just "testDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag [String])) :*: S1 ('MetaSel ('Just "initHcPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath))) :*: (S1 ('MetaSel ('Just "initVerbosity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Verbosity)) :*: S1 ('MetaSel ('Just "overwrite") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))))))))

## Targets and descriptions

data PkgDescription #

`PkgDescription` represents the relevant options set by the user when building a package description during the init command process.

Constructors

PkgDescription |

Fields

- _pkgCabalVersion :: CabalSpecVersion
- _pkgName :: PackageName
- _pkgVersion :: Version
- _pkgLicense :: SpecLicense
- _pkgAuthor :: String
- _pkgEmail :: String
- _pkgHomePage :: String
- _pkgSynopsis :: String
- _pkgCategory :: String
- _pkgExtraSrcFiles :: Set String
- _pkgExtraDocFiles :: Maybe (Set String)

#### Instances

Instances details

Show PkgDescription # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> PkgDescription -> ShowS # show :: PkgDescription -> String # showList :: [PkgDescription] -> ShowS #
Eq PkgDescription # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: PkgDescription -> PkgDescription -> Bool # (/=) :: PkgDescription -> PkgDescription -> Bool #

data LibTarget #

`LibTarget` represents the relevant options set by the user when building a library package during the init command process.

Constructors

LibTarget |

Fields

- _libSourceDirs :: [String]
- _libLanguage :: Language
- _libExposedModules :: NonEmpty ModuleName
- _libOtherModules :: [ModuleName]
- _libOtherExts :: [Extension]
- _libDependencies :: [Dependency]
- _libBuildTools :: [Dependency]

#### Instances

Instances details

Show LibTarget # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> LibTarget -> ShowS # show :: LibTarget -> String # showList :: [LibTarget] -> ShowS #
Eq LibTarget # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: LibTarget -> LibTarget -> Bool # (/=) :: LibTarget -> LibTarget -> Bool #

data ExeTarget #

`ExeTarget` represents the relevant options set by the user when building an executable package.

Constructors

ExeTarget |

Fields

- _exeMainIs :: HsFilePath
- _exeApplicationDirs :: [String]
- _exeLanguage :: Language
- _exeOtherModules :: [ModuleName]
- _exeOtherExts :: [Extension]
- _exeDependencies :: [Dependency]
- _exeBuildTools :: [Dependency]

#### Instances

Instances details

Show ExeTarget # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> ExeTarget -> ShowS # show :: ExeTarget -> String # showList :: [ExeTarget] -> ShowS #
Eq ExeTarget # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: ExeTarget -> ExeTarget -> Bool # (/=) :: ExeTarget -> ExeTarget -> Bool #

data TestTarget #

`TestTarget` represents the relevant options set by the user when building a library package.

Constructors

TestTarget |

Fields

- _testMainIs :: HsFilePath
- _testDirs :: [String]
- _testLanguage :: Language
- _testOtherModules :: [ModuleName]
- _testOtherExts :: [Extension]
- _testDependencies :: [Dependency]
- _testBuildTools :: [Dependency]

#### Instances

Instances details

Show TestTarget # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> TestTarget -> ShowS # show :: TestTarget -> String # showList :: [TestTarget] -> ShowS #
Eq TestTarget # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: TestTarget -> TestTarget -> Bool # (/=) :: TestTarget -> TestTarget -> Bool #

## package types

data PackageType #

Enum to denote whether the user wants to build a library target, executable target, library and executable targets, or a standalone test suite.

Constructors

Library |
Executable |
LibraryAndExecutable |
TestSuite |

#### Instances

Instances details

Generic PackageType # |

Instance details

Defined in Distribution.Client.Init.Types

Associated Types

type Rep PackageType |

Instance details

Defined in Distribution.Client.Init.Types

type Rep PackageType = D1 ('MetaData "PackageType" "Distribution.Client.Init.Types" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) ((C1 ('MetaCons "Library" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Executable" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LibraryAndExecutable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TestSuite" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: PackageType -> Rep PackageType x #

to :: Rep PackageType x -> PackageType #

Show PackageType # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> PackageType -> ShowS # show :: PackageType -> String # showList :: [PackageType] -> ShowS #
Eq PackageType # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: PackageType -> PackageType -> Bool # (/=) :: PackageType -> PackageType -> Bool #
type Rep PackageType # |

Instance details

Defined in Distribution.Client.Init.Types

type Rep PackageType = D1 ('MetaData "PackageType" "Distribution.Client.Init.Types" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) ((C1 ('MetaCons "Library" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Executable" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LibraryAndExecutable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TestSuite" 'PrefixI 'False) (U1 :: Type -> Type)))

## Main file

data HsFilePath #

Constructors

HsFilePath |

Fields

- _hsFilePath :: FilePath
- _hsFileType :: HsFileType

#### Instances

Instances details

Show HsFilePath # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> HsFilePath -> ShowS # show :: HsFilePath -> String # showList :: [HsFilePath] -> ShowS #
Eq HsFilePath # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: HsFilePath -> HsFilePath -> Bool # (/=) :: HsFilePath -> HsFilePath -> Bool #

data HsFileType #

Constructors

Literate |
Standard |
InvalidHsPath |

#### Instances

Instances details

Show HsFileType # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> HsFileType -> ShowS # show :: HsFileType -> String # showList :: [HsFileType] -> ShowS #
Eq HsFileType # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: HsFileType -> HsFileType -> Bool # (/=) :: HsFileType -> HsFileType -> Bool #

fromHsFilePath :: HsFilePath -> Maybe FilePath #

toHsFilePath :: FilePath -> HsFilePath #

toLiterateHs :: HsFilePath -> HsFilePath #

toStandardHs :: HsFilePath -> HsFilePath #

mkLiterate :: HsFilePath -> [String] -> [String] #

isHsFilePath :: FilePath -> Bool #

# Typeclasses

class Monad m => Interactive (m :: Type -> Type) where #

Methods

getLine :: m String #

readFile :: FilePath -> m String #

getCurrentDirectory :: m FilePath #

getHomeDirectory :: m FilePath #

getDirectoryContents :: FilePath -> m [FilePath] #

listDirectory :: FilePath -> m [FilePath] #

doesDirectoryExist :: FilePath -> m Bool #

doesFileExist :: FilePath -> m Bool #

canonicalizePathNoThrow :: FilePath -> m FilePath #

readProcessWithExitCode :: FilePath -> [String] -> String -> m (ExitCode, String, String) #

getEnvironment :: m [(String, String)] #

getCurrentYear :: m Integer #

listFilesInside :: (FilePath -> m Bool) -> FilePath -> m [FilePath] #

listFilesRecursive :: FilePath -> m [FilePath] #

putStr :: String -> m () #

putStrLn :: String -> m () #

createDirectory :: FilePath -> m () #

removeDirectory :: FilePath -> m () #

writeFile :: FilePath -> String -> m () #

removeExistingFile :: FilePath -> m () #

copyFile :: FilePath -> FilePath -> m () #

renameDirectory :: FilePath -> FilePath -> m () #

hFlush :: Handle -> m () #

message :: Verbosity -> Severity -> String -> m () #

break :: m Bool #

throwPrompt :: BreakException -> m a #

#### Instances

Instances details

Interactive PurePrompt # |

Instance details

Defined in Distribution.Client.Init.Types

Methods

getLine :: PurePrompt String #

readFile :: FilePath -> PurePrompt String #

getCurrentDirectory :: PurePrompt FilePath #

getHomeDirectory :: PurePrompt FilePath #

getDirectoryContents :: FilePath -> PurePrompt [FilePath] #

listDirectory :: FilePath -> PurePrompt [FilePath] #

doesDirectoryExist :: FilePath -> PurePrompt Bool #

doesFileExist :: FilePath -> PurePrompt Bool #

canonicalizePathNoThrow :: FilePath -> PurePrompt FilePath #

readProcessWithExitCode :: FilePath -> [String] -> String -> PurePrompt (ExitCode, String, String) #

getEnvironment :: PurePrompt [(String, String)] #

getCurrentYear :: PurePrompt Integer #

listFilesInside :: (FilePath -> PurePrompt Bool) -> FilePath -> PurePrompt [FilePath] #

listFilesRecursive :: FilePath -> PurePrompt [FilePath] #

putStr :: String -> PurePrompt () #

putStrLn :: String -> PurePrompt () #

createDirectory :: FilePath -> PurePrompt () #

removeDirectory :: FilePath -> PurePrompt () #

writeFile :: FilePath -> String -> PurePrompt () #

removeExistingFile :: FilePath -> PurePrompt () #

copyFile :: FilePath -> FilePath -> PurePrompt () #

renameDirectory :: FilePath -> FilePath -> PurePrompt () #

hFlush :: Handle -> PurePrompt () #

message :: Verbosity -> Severity -> String -> PurePrompt () #

break :: PurePrompt Bool #

throwPrompt :: BreakException -> PurePrompt a #

Interactive IO # |

Instance details

Defined in Distribution.Client.Init.Types

Methods

getLine :: IO String #

readFile :: FilePath -> IO String #

getCurrentDirectory :: IO FilePath #

getHomeDirectory :: IO FilePath #

getDirectoryContents :: FilePath -> IO [FilePath] #

listDirectory :: FilePath -> IO [FilePath] #

doesDirectoryExist :: FilePath -> IO Bool #

doesFileExist :: FilePath -> IO Bool #

canonicalizePathNoThrow :: FilePath -> IO FilePath #

readProcessWithExitCode :: FilePath -> [String] -> String -> IO (ExitCode, String, String) #

getEnvironment :: IO [(String, String)] #

getCurrentYear :: IO Integer #

listFilesInside :: (FilePath -> IO Bool) -> FilePath -> IO [FilePath] #

listFilesRecursive :: FilePath -> IO [FilePath] #

putStr :: String -> IO () #

putStrLn :: String -> IO () #

createDirectory :: FilePath -> IO () #

removeDirectory :: FilePath -> IO () #

writeFile :: FilePath -> String -> IO () #

removeExistingFile :: FilePath -> IO () #

copyFile :: FilePath -> FilePath -> IO () #

renameDirectory :: FilePath -> FilePath -> IO () #

hFlush :: Handle -> IO () #

message :: Verbosity -> Severity -> String -> IO () #

break :: IO Bool #

throwPrompt :: BreakException -> IO a #

newtype BreakException #

A pure exception thrown exclusively by the pure prompter to cancel infinite loops in the prompting process.

For example, in order to break on parse errors, or user-driven continuations that do not make sense to test.

Constructors

BreakException String |

#### Instances

Instances details

Exception BreakException # |
Instance details Defined in Distribution.Client.Init.Types Methods toException :: BreakException -> SomeException # fromException :: SomeException -> Maybe BreakException # displayException :: BreakException -> String #
Show BreakException # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> BreakException -> ShowS # show :: BreakException -> String # showList :: [BreakException] -> ShowS #
Eq BreakException # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: BreakException -> BreakException -> Bool # (/=) :: BreakException -> BreakException -> Bool #

newtype PurePrompt a #

Constructors

PurePrompt |

Fields

- _runPrompt :: NonEmpty String -> Either BreakException (a, NonEmpty String)

#### Instances

Instances details

Applicative PurePrompt # |
Instance details Defined in Distribution.Client.Init.Types Methods pure :: a -> PurePrompt a # (<*>) :: PurePrompt (a -> b) -> PurePrompt a -> PurePrompt b # liftA2 :: (a -> b -> c) -> PurePrompt a -> PurePrompt b -> PurePrompt c # (*>) :: PurePrompt a -> PurePrompt b -> PurePrompt b # (<*) :: PurePrompt a -> PurePrompt b -> PurePrompt a #
Functor PurePrompt # |
Instance details Defined in Distribution.Client.Init.Types Methods fmap :: (a -> b) -> PurePrompt a -> PurePrompt b # (<$) :: a -> PurePrompt b -> PurePrompt a #
Monad PurePrompt # |
Instance details Defined in Distribution.Client.Init.Types Methods (>>=) :: PurePrompt a -> (a -> PurePrompt b) -> PurePrompt b # (>>) :: PurePrompt a -> PurePrompt b -> PurePrompt b # return :: a -> PurePrompt a #
Interactive PurePrompt # |

Instance details

Defined in Distribution.Client.Init.Types

Methods

getLine :: PurePrompt String #

readFile :: FilePath -> PurePrompt String #

getCurrentDirectory :: PurePrompt FilePath #

getHomeDirectory :: PurePrompt FilePath #

getDirectoryContents :: FilePath -> PurePrompt [FilePath] #

listDirectory :: FilePath -> PurePrompt [FilePath] #

doesDirectoryExist :: FilePath -> PurePrompt Bool #

doesFileExist :: FilePath -> PurePrompt Bool #

canonicalizePathNoThrow :: FilePath -> PurePrompt FilePath #

readProcessWithExitCode :: FilePath -> [String] -> String -> PurePrompt (ExitCode, String, String) #

getEnvironment :: PurePrompt [(String, String)] #

getCurrentYear :: PurePrompt Integer #

listFilesInside :: (FilePath -> PurePrompt Bool) -> FilePath -> PurePrompt [FilePath] #

listFilesRecursive :: FilePath -> PurePrompt [FilePath] #

putStr :: String -> PurePrompt () #

putStrLn :: String -> PurePrompt () #

createDirectory :: FilePath -> PurePrompt () #

removeDirectory :: FilePath -> PurePrompt () #

writeFile :: FilePath -> String -> PurePrompt () #

removeExistingFile :: FilePath -> PurePrompt () #

copyFile :: FilePath -> FilePath -> PurePrompt () #

renameDirectory :: FilePath -> FilePath -> PurePrompt () #

hFlush :: Handle -> PurePrompt () #

message :: Verbosity -> Severity -> String -> PurePrompt () #

break :: PurePrompt Bool #

throwPrompt :: BreakException -> PurePrompt a #

evalPrompt :: PurePrompt a -> NonEmpty String -> a #

data Severity #

Used to inform the intent of prompted messages.

Constructors

Log |
Info |
Warning |
Error |

#### Instances

Instances details

Show Severity # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> Severity -> ShowS # show :: Severity -> String # showList :: [Severity] -> ShowS #
Eq Severity # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: Severity -> Severity -> Bool # (/=) :: Severity -> Severity -> Bool #

# Aliases

type IsLiterate = Bool #

Convenience alias for the literate haskell flag

type IsSimple = Bool #

Convenience alias for generating simple projects

# File creator opts

data WriteOpts #

Constructors

WriteOpts |

Fields

- _optOverwrite :: Bool
- _optMinimal :: Bool
- _optNoComments :: Bool
- _optVerbosity :: Verbosity
- _optPkgDir :: FilePath
- _optPkgType :: PackageType
- _optPkgName :: PackageName
- _optCabalSpec :: CabalSpecVersion

#### Instances

Instances details

Show WriteOpts # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> WriteOpts -> ShowS # show :: WriteOpts -> String # showList :: [WriteOpts] -> ShowS #
Eq WriteOpts # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: WriteOpts -> WriteOpts -> Bool # (/=) :: WriteOpts -> WriteOpts -> Bool #

data ProjectSettings #

Constructors

ProjectSettings |

Fields

- _pkgOpts :: WriteOpts
- _pkgDesc :: PkgDescription
- _pkgLibTarget :: Maybe LibTarget
- _pkgExeTarget :: Maybe ExeTarget
- _pkgTestTarget :: Maybe TestTarget

#### Instances

Instances details

Show ProjectSettings # |
Instance details Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> ProjectSettings -> ShowS # show :: ProjectSettings -> String # showList :: [ProjectSettings] -> ShowS #
Eq ProjectSettings # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: ProjectSettings -> ProjectSettings -> Bool # (/=) :: ProjectSettings -> ProjectSettings -> Bool #

# Formatters

data FieldAnnotation #

Annotations for cabal file PrettyField.

Constructors

FieldAnnotation |

Fields

- annCommentedOut :: Bool

  True iif the field and its contents should be commented out.

- annCommentLines :: CommentPosition

  Comment lines to place before the field or section.

# Other conveniences

data DefaultPrompt t #

Defines whether or not a prompt will have a default value, is optional, or is mandatory.

Constructors

DefaultPrompt t |
OptionalPrompt |
MandatoryPrompt |

#### Instances

Instances details

Functor DefaultPrompt # |
Instance details Defined in Distribution.Client.Init.Types Methods fmap :: (a -> b) -> DefaultPrompt a -> DefaultPrompt b # (<$) :: a -> DefaultPrompt b -> DefaultPrompt a #
Eq t => Eq (DefaultPrompt t) # |
Instance details Defined in Distribution.Client.Init.Types Methods (==) :: DefaultPrompt t -> DefaultPrompt t -> Bool # (/=) :: DefaultPrompt t -> DefaultPrompt t -> Bool #