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
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 {}
- data LibTarget = LibTarget {}
- data ExeTarget = ExeTarget {}
- data TestTarget = TestTarget {}
- data PackageType
- data HsFilePath = HsFilePath {}
- data HsFileType
- 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
- type IsLiterate = Bool
- type IsSimple = Bool
- data WriteOpts = WriteOpts {}
- data ProjectSettings = ProjectSettings {}
- data FieldAnnotation = FieldAnnotation {}
- data DefaultPrompt t
Data
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
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
|
Instances
Show PkgDescription # | |
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> PkgDescription -> ShowS # show :: PkgDescription -> String # showList :: [PkgDescription] -> ShowS # | |
Eq PkgDescription # | |
Defined in Distribution.Client.Init.Types Methods (==) :: PkgDescription -> PkgDescription -> Bool # (/=) :: PkgDescription -> PkgDescription -> Bool # |
LibTarget
represents the relevant options set by the
user when building a library package during the init command
process.
Constructors
LibTarget | |
Fields
|
ExeTarget
represents the relevant options set by the
user when building an executable package.
Constructors
ExeTarget | |
Fields
|
data TestTarget #
TestTarget
represents the relevant options set by the
user when building a library package.
Constructors
TestTarget | |
Fields
|
Instances
Show TestTarget # | |
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> TestTarget -> ShowS # show :: TestTarget -> String # showList :: [TestTarget] -> ShowS # | |
Eq TestTarget # | |
Defined in Distribution.Client.Init.Types |
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
Generic PackageType # | |||||
Defined in Distribution.Client.Init.Types Associated Types
| |||||
Show PackageType # | |||||
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> PackageType -> ShowS # show :: PackageType -> String # showList :: [PackageType] -> ShowS # | |||||
Eq PackageType # | |||||
Defined in Distribution.Client.Init.Types | |||||
type Rep PackageType # | |||||
Defined in Distribution.Client.Init.Types type Rep PackageType = D1 ('MetaData "PackageType" "Distribution.Client.Init.Types" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" '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 |
Instances
Show HsFilePath # | |
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> HsFilePath -> ShowS # show :: HsFilePath -> String # showList :: [HsFilePath] -> ShowS # | |
Eq HsFilePath # | |
Defined in Distribution.Client.Init.Types |
data HsFileType #
Constructors
Literate | |
Standard | |
InvalidHsPath |
Instances
Show HsFileType # | |
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> HsFileType -> ShowS # show :: HsFileType -> String # showList :: [HsFileType] -> ShowS # | |
Eq HsFileType # | |
Defined in Distribution.Client.Init.Types |
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
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] #
createDirectory :: FilePath -> m () #
removeDirectory :: FilePath -> m () #
writeFile :: FilePath -> String -> m () #
removeExistingFile :: FilePath -> m () #
copyFile :: FilePath -> FilePath -> m () #
renameDirectory :: FilePath -> FilePath -> m () #
message :: Verbosity -> Severity -> String -> m () #
throwPrompt :: BreakException -> m a #
Instances
Interactive PurePrompt # | |
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 # | |
Defined in Distribution.Client.Init.Types Methods 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] # createDirectory :: FilePath -> IO () # removeDirectory :: FilePath -> IO () # writeFile :: FilePath -> String -> IO () # removeExistingFile :: FilePath -> IO () # copyFile :: FilePath -> FilePath -> IO () # renameDirectory :: FilePath -> FilePath -> IO () # message :: Verbosity -> Severity -> String -> IO () # 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
Exception BreakException # | |
Defined in Distribution.Client.Init.Types Methods toException :: BreakException -> SomeException # fromException :: SomeException -> Maybe BreakException # displayException :: BreakException -> String # backtraceDesired :: BreakException -> Bool # | |
Show BreakException # | |
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> BreakException -> ShowS # show :: BreakException -> String # showList :: [BreakException] -> ShowS # | |
Eq BreakException # | |
Defined in Distribution.Client.Init.Types Methods (==) :: BreakException -> BreakException -> Bool # (/=) :: BreakException -> BreakException -> Bool # |
newtype PurePrompt a #
Constructors
PurePrompt | |
Fields
|
Instances
Interactive PurePrompt # | |
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 # | |
Applicative PurePrompt # | |
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 # | |
Defined in Distribution.Client.Init.Types Methods fmap :: (a -> b) -> PurePrompt a -> PurePrompt b # (<$) :: a -> PurePrompt b -> PurePrompt a # | |
Monad PurePrompt # | |
Defined in Distribution.Client.Init.Types Methods (>>=) :: PurePrompt a -> (a -> PurePrompt b) -> PurePrompt b # (>>) :: PurePrompt a -> PurePrompt b -> PurePrompt b # return :: a -> PurePrompt a # |
evalPrompt :: PurePrompt a -> NonEmpty String -> a #
Used to inform the intent of prompted messages.
Aliases
type IsLiterate = Bool #
Convenience alias for the literate haskell flag
File creator opts
data ProjectSettings #
Constructors
ProjectSettings | |
Fields |
Instances
Show ProjectSettings # | |
Defined in Distribution.Client.Init.Types Methods showsPrec :: Int -> ProjectSettings -> ShowS # show :: ProjectSettings -> String # showList :: [ProjectSettings] -> ShowS # | |
Eq ProjectSettings # | |
Defined in Distribution.Client.Init.Types Methods (==) :: ProjectSettings -> ProjectSettings -> Bool # (/=) :: ProjectSettings -> ProjectSettings -> Bool # |
Formatters
data FieldAnnotation #
Annotations for cabal file PrettyField.
Constructors
FieldAnnotation | |
Fields
|
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
Functor DefaultPrompt # | |
Defined in Distribution.Client.Init.Types Methods fmap :: (a -> b) -> DefaultPrompt a -> DefaultPrompt b # (<$) :: a -> DefaultPrompt b -> DefaultPrompt a # | |
Eq t => Eq (DefaultPrompt t) # | |
Defined in Distribution.Client.Init.Types Methods (==) :: DefaultPrompt t -> DefaultPrompt t -> Bool # (/=) :: DefaultPrompt t -> DefaultPrompt t -> Bool # |