Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Interaction.Options

Synopsis

- data CommandLineOptions = Options {
  - optProgramName :: String
  - optInputFile :: Maybe FilePath
  - optIncludePaths :: [FilePath]
  - optAbsoluteIncludePaths :: [AbsolutePath]
  - optLibraries :: [LibName]
  - optOverrideLibrariesFile :: Maybe FilePath
  - optDefaultLibs :: Bool
  - optUseLibs :: Bool
  - optShowVersion :: Bool
  - optShowHelp :: Bool
  - optInteractive :: Bool
  - optGHCiInteraction :: Bool
  - optCompileNoMain :: Bool
  - optGhcCompile :: Bool
  - optGhcCallGhc :: Bool
  - optGhcFlags :: [String]
  - optEpicCompile :: Bool
  - optJSCompile :: Bool
  - optUHCCompile :: Bool
  - optUHCBin :: Maybe FilePath
  - optUHCTextualCore :: Bool
  - optUHCCallUHC :: Bool
  - optUHCTraceLevel :: Int
  - optUHCFlags :: [String]
  - optOptimSmashing :: Bool
  - optCompileDir :: Maybe FilePath
  - optGenerateVimFile :: Bool
  - optGenerateLaTeX :: Bool
  - optGenerateHTML :: Bool
  - optDependencyGraph :: Maybe FilePath
  - optLaTeXDir :: FilePath
  - optHTMLDir :: FilePath
  - optCSSFile :: Maybe FilePath
  - optIgnoreInterfaces :: Bool
  - optForcing :: Bool
  - optPragmaOptions :: PragmaOptions
  - optEpicFlags :: [String]
  - optSafe :: Bool
  - optSharing :: Bool
  - optCaching :: Bool
  }
- data IgnoreFlags
  - = IgnoreFlags
  - | RespectFlags
- data PragmaOptions = PragmaOptions {
  - optShowImplicit :: Bool
  - optShowIrrelevant :: Bool
  - optVerbose :: Verbosity
  - optProofIrrelevance :: Bool
  - optAllowUnsolved :: Bool
  - optDisablePositivity :: Bool
  - optTerminationCheck :: Bool
  - optTerminationDepth :: CutOff
  - optCompletenessCheck :: Bool
  - optUniverseCheck :: Bool
  - optSizedTypes :: Bool
  - optInjectiveTypeConstructors :: Bool
  - optGuardingTypeConstructors :: Bool
  - optUniversePolymorphism :: Bool
  - optIrrelevantProjections :: Bool
  - optExperimentalIrrelevance :: Bool
  - optWithoutK :: Bool
  - optCopatterns :: Bool
  - optPatternMatching :: Bool
  - optExactSplit :: Bool
  - optEta :: Bool
  - optRewriting :: Bool
  - optPostfixProjections :: Bool
  - optInstanceSearchDepth :: Int
  }
- type OptionsPragma = [String]
- type Flag opts = opts -> OptM opts
- type OptM = ExceptT String IO
- runOptM :: OptM a -> IO (Either String a)
- type Verbosity = Trie String Int
- checkOpts :: Flag CommandLineOptions
- parseStandardOptions :: [String] -> OptM CommandLineOptions
- parseStandardOptions' :: [String] -> Flag CommandLineOptions
- parsePragmaOptions :: [String] -> CommandLineOptions -> OptM PragmaOptions
- parsePluginOptions :: [String] -> [OptDescr (Flag opts)] -> Flag opts
- defaultOptions :: CommandLineOptions
- defaultInteractionOptions :: PragmaOptions
- defaultVerbosity :: Verbosity
- defaultCutOff :: CutOff
- defaultPragmaOptions :: PragmaOptions
- standardOptions_ :: [OptDescr ()]
- unsafePragmaOptions :: PragmaOptions -> [String]
- isLiterate :: FilePath -> Bool
- mapFlag :: (String -> String) -> OptDescr a -> OptDescr a
- usage :: [OptDescr ()] -> String -> String
- defaultLibDir :: IO FilePath
- inputFlag :: FilePath -> Flag CommandLineOptions
- standardOptions :: [OptDescr (Flag CommandLineOptions)]
- getOptSimple :: [String] -> [OptDescr (Flag opts)] -> (String -> Flag opts) -> Flag opts

# Documentation

data CommandLineOptions #

Constructors

Options |
Fields optProgramName :: String optInputFile :: Maybe FilePath optIncludePaths :: [FilePath] optAbsoluteIncludePaths :: [AbsolutePath] optLibraries :: [LibName] optOverrideLibrariesFile :: Maybe FilePath Use this (if Just) instead of .agda/libraries optDefaultLibs :: Bool Use ~.agdadefaults optUseLibs :: Bool look for .agda-lib files optShowVersion :: Bool optShowHelp :: Bool optInteractive :: Bool optGHCiInteraction :: Bool optCompileNoMain :: Bool optGhcCompile :: Bool optGhcCallGhc :: Bool optGhcFlags :: [String] optEpicCompile :: Bool optJSCompile :: Bool optUHCCompile :: Bool optUHCBin :: Maybe FilePath optUHCTextualCore :: Bool optUHCCallUHC :: Bool optUHCTraceLevel :: Int optUHCFlags :: [String] optOptimSmashing :: Bool optCompileDir :: Maybe FilePath In the absence of a path the project root is used. optGenerateVimFile :: Bool optGenerateLaTeX :: Bool optGenerateHTML :: Bool optDependencyGraph :: Maybe FilePath optLaTeXDir :: FilePath optHTMLDir :: FilePath optCSSFile :: Maybe FilePath optIgnoreInterfaces :: Bool optForcing :: Bool optPragmaOptions :: PragmaOptions optEpicFlags :: [String] optSafe :: Bool optSharing :: Bool optCaching :: Bool

Instances

Show CommandLineOptions # |
Methods showsPrec :: Int -> CommandLineOptions -> ShowS # show :: CommandLineOptions -> String # showList :: [CommandLineOptions] -> ShowS #
LensPersistentVerbosity CommandLineOptions # |
Methods getPersistentVerbosity :: CommandLineOptions -> PersistentVerbosity # setPersistentVerbosity :: PersistentVerbosity -> CommandLineOptions -> CommandLineOptions # mapPersistentVerbosity :: (PersistentVerbosity -> PersistentVerbosity) -> CommandLineOptions -> CommandLineOptions #
LensIncludePaths CommandLineOptions # |
Methods getIncludePaths :: CommandLineOptions -> [FilePath] # setIncludePaths :: [FilePath] -> CommandLineOptions -> CommandLineOptions # mapIncludePaths :: ([FilePath] -> [FilePath]) -> CommandLineOptions -> CommandLineOptions # getAbsoluteIncludePaths :: CommandLineOptions -> [AbsolutePath] # setAbsoluteIncludePaths :: [AbsolutePath] -> CommandLineOptions -> CommandLineOptions # mapAbsoluteIncludePaths :: ([AbsolutePath] -> [AbsolutePath]) -> CommandLineOptions -> CommandLineOptions #
LensSafeMode CommandLineOptions # |
Methods getSafeMode :: CommandLineOptions -> SafeMode # setSafeMode :: SafeMode -> CommandLineOptions -> CommandLineOptions # mapSafeMode :: (SafeMode -> SafeMode) -> CommandLineOptions -> CommandLineOptions #
LensPragmaOptions CommandLineOptions # |
Methods getPragmaOptions :: CommandLineOptions -> PragmaOptions # setPragmaOptions :: PragmaOptions -> CommandLineOptions -> CommandLineOptions # mapPragmaOptions :: (PragmaOptions -> PragmaOptions) -> CommandLineOptions -> CommandLineOptions #

data IgnoreFlags #

Constructors

IgnoreFlags |
RespectFlags |

Instances

Eq IgnoreFlags # |
Methods (==) :: IgnoreFlags -> IgnoreFlags -> Bool # (/=) :: IgnoreFlags -> IgnoreFlags -> Bool #

data PragmaOptions #

Options which can be set in a pragma.

Constructors

PragmaOptions |
Fields optShowImplicit :: Bool optShowIrrelevant :: Bool optVerbose :: Verbosity optProofIrrelevance :: Bool optAllowUnsolved :: Bool optDisablePositivity :: Bool optTerminationCheck :: Bool optTerminationDepth :: CutOff Cut off structural order comparison at some depth in termination checker? optCompletenessCheck :: Bool optUniverseCheck :: Bool optSizedTypes :: Bool optInjectiveTypeConstructors :: Bool optGuardingTypeConstructors :: Bool optUniversePolymorphism :: Bool optIrrelevantProjections :: Bool optExperimentalIrrelevance :: Bool irrelevant levels, irrelevant data matching optWithoutK :: Bool optCopatterns :: Bool Allow definitions by copattern matching? optPatternMatching :: Bool Is pattern matching allowed in the current file? optExactSplit :: Bool optEta :: Bool optRewriting :: Bool Can rewrite rules be added and used? optPostfixProjections :: Bool Should system generated projections `ProjSystem` be printed postfix (True) or prefix (False). optInstanceSearchDepth :: Int

Instances

Eq PragmaOptions # |
Methods (==) :: PragmaOptions -> PragmaOptions -> Bool # (/=) :: PragmaOptions -> PragmaOptions -> Bool #
Show PragmaOptions # |
Methods showsPrec :: Int -> PragmaOptions -> ShowS # show :: PragmaOptions -> String # showList :: [PragmaOptions] -> ShowS #
LensPersistentVerbosity PragmaOptions # |
Methods getPersistentVerbosity :: PragmaOptions -> PersistentVerbosity # setPersistentVerbosity :: PersistentVerbosity -> PragmaOptions -> PragmaOptions # mapPersistentVerbosity :: (PersistentVerbosity -> PersistentVerbosity) -> PragmaOptions -> PragmaOptions #
LensVerbosity PragmaOptions # |
Methods getVerbosity :: PragmaOptions -> Verbosity # setVerbosity :: Verbosity -> PragmaOptions -> PragmaOptions # mapVerbosity :: (Verbosity -> Verbosity) -> PragmaOptions -> PragmaOptions #

type OptionsPragma = [String] #

The options from an `OPTIONS` pragma.

In the future it might be nice to switch to a more structured representation. Note that, currently, there is not a one-to-one correspondence between list elements and options.

type Flag opts = opts -> OptM opts #

`f :: Flag opts` is an action on the option record that results from parsing an option. `f opts` produces either an error message or an updated options record

type OptM = ExceptT String IO #

runOptM :: OptM a -> IO (Either String a) #

type Verbosity = Trie String Int #

checkOpts :: Flag CommandLineOptions #

Checks that the given options are consistent.

parseStandardOptions :: [String] -> OptM CommandLineOptions #

Parse the standard options.

parseStandardOptions' :: [String] -> Flag CommandLineOptions #

parsePragmaOptions #

Arguments

:: [String] | Pragma options.
-> CommandLineOptions | Command-line options which should be updated.
-> OptM PragmaOptions |

Parse options from an options pragma.

parsePluginOptions :: [String] -> [OptDescr (Flag opts)] -> Flag opts #

Parse options for a plugin.

defaultOptions :: CommandLineOptions #

defaultInteractionOptions :: PragmaOptions #

defaultVerbosity :: Verbosity #

defaultCutOff :: CutOff #

The default termination depth.

defaultPragmaOptions :: PragmaOptions #

standardOptions_ :: [OptDescr ()] #

Used for printing usage info.

unsafePragmaOptions :: PragmaOptions -> [String] #

Check for unsafe pramas. Gives a list of used unsafe flags.

isLiterate :: FilePath -> Bool #

This should probably go somewhere else.

mapFlag :: (String -> String) -> OptDescr a -> OptDescr a #

Map a function over the long options. Also removes the short options. Will be used to add the plugin name to the plugin options.

usage :: [OptDescr ()] -> String -> String #

The usage info message. The argument is the program name (probably agda).

defaultLibDir :: IO FilePath #

Returns the absolute default lib dir. This directory is used to store the Primitive.agda file.

inputFlag :: FilePath -> Flag CommandLineOptions #

standardOptions :: [OptDescr (Flag CommandLineOptions)] #

getOptSimple #

Arguments

:: [String] | command line argument words
-> [OptDescr (Flag opts)] | options handlers
-> (String -> Flag opts) | handler of non-options (only one is allowed)
-> Flag opts | combined opts data structure transformer

Simple interface for System.Console.GetOpt Could be moved to Agda.Utils.Options (does not exist yet)