cabal-install-3.8.1.0: The command-line interface for Cabal and Hackage.
Copyright(c) Brent Yorgey Benedikt Huber 2009
LicenseBSD-like
Maintainercabal-devel@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.Init.Types

Description

Some types used by the 'cabal init' command.

Synopsis

Data

data InitFlags Source #

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

Instances

Instances details
Monoid InitFlags Source # 
Instance details

Defined in Distribution.Client.Init.Types

Semigroup InitFlags Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(<>) :: InitFlags -> InitFlags -> InitFlags

sconcat :: NonEmpty InitFlags -> InitFlags

stimes :: Integral b => b -> InitFlags -> InitFlags

Generic InitFlags Source # 
Instance details

Defined in Distribution.Client.Init.Types

Associated Types

type Rep InitFlags :: Type -> Type

Methods

from :: InitFlags -> Rep InitFlags x

to :: Rep InitFlags x -> InitFlags

Show InitFlags Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> InitFlags -> ShowS

show :: InitFlags -> String

showList :: [InitFlags] -> ShowS

Eq InitFlags Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: InitFlags -> InitFlags -> Bool

(/=) :: InitFlags -> InitFlags -> Bool

type Rep InitFlags Source # 
Instance details

Defined in Distribution.Client.Init.Types

type Rep InitFlags = D1 ('MetaData "InitFlags" "Distribution.Client.Init.Types" "cabal-install-3.8.1.0-CiByXgAz4HmCCkgLTHZiBJ" '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 Source #

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

Constructors

PkgDescription 

Fields

Instances

Instances details
Show PkgDescription Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> PkgDescription -> ShowS

show :: PkgDescription -> String

showList :: [PkgDescription] -> ShowS

Eq PkgDescription Source # 
Instance details

Defined in Distribution.Client.Init.Types

data LibTarget Source #

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

Constructors

LibTarget 

Fields

Instances

Instances details
Show LibTarget Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> LibTarget -> ShowS

show :: LibTarget -> String

showList :: [LibTarget] -> ShowS

Eq LibTarget Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: LibTarget -> LibTarget -> Bool

(/=) :: LibTarget -> LibTarget -> Bool

data ExeTarget Source #

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

Constructors

ExeTarget 

Fields

Instances

Instances details
Show ExeTarget Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> ExeTarget -> ShowS

show :: ExeTarget -> String

showList :: [ExeTarget] -> ShowS

Eq ExeTarget Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: ExeTarget -> ExeTarget -> Bool

(/=) :: ExeTarget -> ExeTarget -> Bool

data TestTarget Source #

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

Constructors

TestTarget 

Fields

Instances

Instances details
Show TestTarget Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> TestTarget -> ShowS

show :: TestTarget -> String

showList :: [TestTarget] -> ShowS

Eq TestTarget Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: TestTarget -> TestTarget -> Bool

(/=) :: TestTarget -> TestTarget -> Bool

package types

data PackageType Source #

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

Instances

Instances details
Generic PackageType Source # 
Instance details

Defined in Distribution.Client.Init.Types

Associated Types

type Rep PackageType :: Type -> Type

Methods

from :: PackageType -> Rep PackageType x

to :: Rep PackageType x -> PackageType

Show PackageType Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> PackageType -> ShowS

show :: PackageType -> String

showList :: [PackageType] -> ShowS

Eq PackageType Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: PackageType -> PackageType -> Bool

(/=) :: PackageType -> PackageType -> Bool

type Rep PackageType Source # 
Instance details

Defined in Distribution.Client.Init.Types

type Rep PackageType = D1 ('MetaData "PackageType" "Distribution.Client.Init.Types" "cabal-install-3.8.1.0-CiByXgAz4HmCCkgLTHZiBJ" '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 Source #

Constructors

HsFilePath 

Fields

Instances

Instances details
Show HsFilePath Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> HsFilePath -> ShowS

show :: HsFilePath -> String

showList :: [HsFilePath] -> ShowS

Eq HsFilePath Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: HsFilePath -> HsFilePath -> Bool

(/=) :: HsFilePath -> HsFilePath -> Bool

data HsFileType Source #

Instances

Instances details
Show HsFileType Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> HsFileType -> ShowS

show :: HsFileType -> String

showList :: [HsFileType] -> ShowS

Eq HsFileType Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: HsFileType -> HsFileType -> Bool

(/=) :: HsFileType -> HsFileType -> Bool

fromHsFilePath :: HsFilePath -> Maybe FilePath Source #

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

isHsFilePath :: FilePath -> Bool Source #

Typeclasses

class Monad m => Interactive m where Source #

Methods

getLine :: m String Source #

readFile :: FilePath -> m String Source #

getCurrentDirectory :: m FilePath Source #

getHomeDirectory :: m FilePath Source #

getDirectoryContents :: FilePath -> m [FilePath] Source #

listDirectory :: FilePath -> m [FilePath] Source #

doesDirectoryExist :: FilePath -> m Bool Source #

doesFileExist :: FilePath -> m Bool Source #

canonicalizePathNoThrow :: FilePath -> m FilePath Source #

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

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

getCurrentYear :: m Integer Source #

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

listFilesRecursive :: FilePath -> m [FilePath] Source #

putStr :: String -> m () Source #

putStrLn :: String -> m () Source #

createDirectory :: FilePath -> m () Source #

removeDirectory :: FilePath -> m () Source #

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

removeExistingFile :: FilePath -> m () Source #

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

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

hFlush :: Handle -> m () Source #

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

break :: m Bool Source #

throwPrompt :: BreakException -> m a Source #

Instances

Instances details
Interactive PurePrompt Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

getLine :: PurePrompt String Source #

readFile :: FilePath -> PurePrompt String Source #

getCurrentDirectory :: PurePrompt FilePath Source #

getHomeDirectory :: PurePrompt FilePath Source #

getDirectoryContents :: FilePath -> PurePrompt [FilePath] Source #

listDirectory :: FilePath -> PurePrompt [FilePath] Source #

doesDirectoryExist :: FilePath -> PurePrompt Bool Source #

doesFileExist :: FilePath -> PurePrompt Bool Source #

canonicalizePathNoThrow :: FilePath -> PurePrompt FilePath Source #

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

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

getCurrentYear :: PurePrompt Integer Source #

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

listFilesRecursive :: FilePath -> PurePrompt [FilePath] Source #

putStr :: String -> PurePrompt () Source #

putStrLn :: String -> PurePrompt () Source #

createDirectory :: FilePath -> PurePrompt () Source #

removeDirectory :: FilePath -> PurePrompt () Source #

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

removeExistingFile :: FilePath -> PurePrompt () Source #

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

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

hFlush :: Handle -> PurePrompt () Source #

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

break :: PurePrompt Bool Source #

throwPrompt :: BreakException -> PurePrompt a Source #

Interactive IO Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

getLine :: IO String Source #

readFile :: FilePath -> IO String Source #

getCurrentDirectory :: IO FilePath Source #

getHomeDirectory :: IO FilePath Source #

getDirectoryContents :: FilePath -> IO [FilePath] Source #

listDirectory :: FilePath -> IO [FilePath] Source #

doesDirectoryExist :: FilePath -> IO Bool Source #

doesFileExist :: FilePath -> IO Bool Source #

canonicalizePathNoThrow :: FilePath -> IO FilePath Source #

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

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

getCurrentYear :: IO Integer Source #

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

listFilesRecursive :: FilePath -> IO [FilePath] Source #

putStr :: String -> IO () Source #

putStrLn :: String -> IO () Source #

createDirectory :: FilePath -> IO () Source #

removeDirectory :: FilePath -> IO () Source #

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

removeExistingFile :: FilePath -> IO () Source #

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

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

hFlush :: Handle -> IO () Source #

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

break :: IO Bool Source #

throwPrompt :: BreakException -> IO a Source #

newtype BreakException Source #

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 Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

toException :: BreakException -> SomeException

fromException :: SomeException -> Maybe BreakException

displayException :: BreakException -> String

Show BreakException Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> BreakException -> ShowS

show :: BreakException -> String

showList :: [BreakException] -> ShowS

Eq BreakException Source # 
Instance details

Defined in Distribution.Client.Init.Types

newtype PurePrompt a Source #

Constructors

PurePrompt 

Fields

Instances

Instances details
Applicative PurePrompt Source # 
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 Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

fmap :: (a -> b) -> PurePrompt a -> PurePrompt b

(<$) :: a -> PurePrompt b -> PurePrompt a

Monad PurePrompt Source # 
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 Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

getLine :: PurePrompt String Source #

readFile :: FilePath -> PurePrompt String Source #

getCurrentDirectory :: PurePrompt FilePath Source #

getHomeDirectory :: PurePrompt FilePath Source #

getDirectoryContents :: FilePath -> PurePrompt [FilePath] Source #

listDirectory :: FilePath -> PurePrompt [FilePath] Source #

doesDirectoryExist :: FilePath -> PurePrompt Bool Source #

doesFileExist :: FilePath -> PurePrompt Bool Source #

canonicalizePathNoThrow :: FilePath -> PurePrompt FilePath Source #

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

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

getCurrentYear :: PurePrompt Integer Source #

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

listFilesRecursive :: FilePath -> PurePrompt [FilePath] Source #

putStr :: String -> PurePrompt () Source #

putStrLn :: String -> PurePrompt () Source #

createDirectory :: FilePath -> PurePrompt () Source #

removeDirectory :: FilePath -> PurePrompt () Source #

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

removeExistingFile :: FilePath -> PurePrompt () Source #

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

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

hFlush :: Handle -> PurePrompt () Source #

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

break :: PurePrompt Bool Source #

throwPrompt :: BreakException -> PurePrompt a Source #

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

data Severity Source #

Used to inform the intent of prompted messages.

Constructors

Log 
Info 
Warning 
Error 

Instances

Instances details
Show Severity Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> Severity -> ShowS

show :: Severity -> String

showList :: [Severity] -> ShowS

Eq Severity Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: Severity -> Severity -> Bool

(/=) :: Severity -> Severity -> Bool

Aliases

type IsLiterate = Bool Source #

Convenience alias for the literate haskell flag

type IsSimple = Bool Source #

Convenience alias for generating simple projects

File creator opts

data WriteOpts Source #

Constructors

WriteOpts 

Fields

Instances

Instances details
Show WriteOpts Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> WriteOpts -> ShowS

show :: WriteOpts -> String

showList :: [WriteOpts] -> ShowS

Eq WriteOpts Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: WriteOpts -> WriteOpts -> Bool

(/=) :: WriteOpts -> WriteOpts -> Bool

data ProjectSettings Source #

Instances

Instances details
Show ProjectSettings Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

showsPrec :: Int -> ProjectSettings -> ShowS

show :: ProjectSettings -> String

showList :: [ProjectSettings] -> ShowS

Eq ProjectSettings Source # 
Instance details

Defined in Distribution.Client.Init.Types

Formatters

data FieldAnnotation Source #

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 Source #

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

Instances

Instances details
Functor DefaultPrompt Source # 
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) Source # 
Instance details

Defined in Distribution.Client.Init.Types

Methods

(==) :: DefaultPrompt t -> DefaultPrompt t -> Bool

(/=) :: DefaultPrompt t -> DefaultPrompt t -> Bool