{-# LANGUAGE DataKinds #-}
{-# OPTIONS_GHC -Wunused-imports #-}
module Agda.Interaction.Options.Types where
import Control.DeepSeq ( NFData )
import Data.Functor ( (<&>) )
import Data.Map ( Map )
import GHC.Generics ( Generic )
import Agda.Syntax.Common ( Cubical )
import Agda.Syntax.Concrete.Glyph ( UnicodeOrAscii )
import Agda.Interaction.Library ( ExeName, LibName )
import Agda.Interaction.Options.Help ( Help )
import Agda.Interaction.Options.Warnings ( WarningMode )
import Agda.Termination.CutOff ( CutOff )
import Agda.Utils.FileName ( AbsolutePath )
import Agda.Utils.Lens ( Lens', (^.), over )
import Agda.Utils.List1 ( String1 )
import qualified Agda.Utils.Maybe.Strict as Strict
import Agda.Utils.ProfileOptions ( ProfileOptions )
import Agda.Utils.Trie ( Trie )
import Agda.Utils.WithDefault ( WithDefault, WithDefault' )
data CommandLineOptions = Options
{ CommandLineOptions -> String
optProgramName :: String
, CommandLineOptions -> Maybe String
optInputFile :: Maybe FilePath
, CommandLineOptions -> [String]
optIncludePaths :: [FilePath]
, CommandLineOptions -> [AbsolutePath]
optAbsoluteIncludePaths :: [AbsolutePath]
, CommandLineOptions -> [LibName]
optLibraries :: [LibName]
, CommandLineOptions -> Maybe String
optOverrideLibrariesFile :: Maybe FilePath
, CommandLineOptions -> Bool
optDefaultLibs :: Bool
, CommandLineOptions -> Bool
optUseLibs :: Bool
, CommandLineOptions -> Integer
optTraceImports :: Integer
, CommandLineOptions -> Map ExeName String
optTrustedExecutables :: Map ExeName FilePath
, CommandLineOptions -> Bool
optPrintAgdaDataDir :: Bool
, CommandLineOptions -> Bool
optPrintAgdaAppDir :: Bool
, CommandLineOptions -> Maybe PrintAgdaVersion
optPrintVersion :: Maybe PrintAgdaVersion
, CommandLineOptions -> Maybe Help
optPrintHelp :: Maybe Help
, CommandLineOptions -> Bool
optInteractive :: Bool
, CommandLineOptions -> Bool
optGHCiInteraction :: Bool
, CommandLineOptions -> Bool
optJSONInteraction :: Bool
, CommandLineOptions -> Bool
optExitOnError :: !Bool
, CommandLineOptions -> Maybe String
optCompileDir :: Maybe FilePath
, CommandLineOptions -> Bool
optGenerateVimFile :: Bool
, CommandLineOptions -> Bool
optIgnoreInterfaces :: Bool
, CommandLineOptions -> Bool
optIgnoreAllInterfaces :: Bool
, CommandLineOptions -> PragmaOptions
optPragmaOptions :: PragmaOptions
, CommandLineOptions -> Bool
optOnlyScopeChecking :: Bool
, CommandLineOptions -> Bool
optTransliterate :: Bool
, CommandLineOptions -> DiagnosticsColours
optDiagnosticsColour :: DiagnosticsColours
}
deriving (Int -> CommandLineOptions -> ShowS
[CommandLineOptions] -> ShowS
CommandLineOptions -> String
(Int -> CommandLineOptions -> ShowS)
-> (CommandLineOptions -> String)
-> ([CommandLineOptions] -> ShowS)
-> Show CommandLineOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CommandLineOptions -> ShowS
showsPrec :: Int -> CommandLineOptions -> ShowS
$cshow :: CommandLineOptions -> String
show :: CommandLineOptions -> String
$cshowList :: [CommandLineOptions] -> ShowS
showList :: [CommandLineOptions] -> ShowS
Show, (forall x. CommandLineOptions -> Rep CommandLineOptions x)
-> (forall x. Rep CommandLineOptions x -> CommandLineOptions)
-> Generic CommandLineOptions
forall x. Rep CommandLineOptions x -> CommandLineOptions
forall x. CommandLineOptions -> Rep CommandLineOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CommandLineOptions -> Rep CommandLineOptions x
from :: forall x. CommandLineOptions -> Rep CommandLineOptions x
$cto :: forall x. Rep CommandLineOptions x -> CommandLineOptions
to :: forall x. Rep CommandLineOptions x -> CommandLineOptions
Generic)
data PragmaOptions = PragmaOptions
{ PragmaOptions -> WithDefault 'False
_optShowImplicit :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optShowGeneralized :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optShowIrrelevant :: WithDefault 'False
, PragmaOptions -> WithDefault' UnicodeOrAscii 'True
_optUseUnicode :: WithDefault' UnicodeOrAscii 'True
, PragmaOptions -> Verbosity
_optVerbose :: !Verbosity
, PragmaOptions -> ProfileOptions
_optProfiling :: ProfileOptions
, PragmaOptions -> WithDefault 'False
_optProp :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optLevelUniverse :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optTwoLevel :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optAllowUnsolved :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optAllowIncompleteMatch :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optPositivityCheck :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optTerminationCheck :: WithDefault 'True
, PragmaOptions -> CutOff
_optTerminationDepth :: CutOff
, PragmaOptions -> WithDefault 'True
_optUniverseCheck :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optOmegaInOmega :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optCumulativity :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optSizedTypes :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optGuardedness :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optInjectiveTypeConstructors :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optUniversePolymorphism :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optIrrelevantProjections :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optExperimentalIrrelevance :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optWithoutK :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optCubicalCompatible :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optCopatterns :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optPatternMatching :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optExactSplit :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optHiddenArgumentPuns :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optEta :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optForcing :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optProjectionLike :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optErasure :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optErasedMatches :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optEraseRecordParameters :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optRewriting :: WithDefault 'False
, PragmaOptions -> Maybe Cubical
_optCubical :: Maybe Cubical
, PragmaOptions -> WithDefault 'False
_optGuarded :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optFirstOrder :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optRequireUniqueMetaSolutions :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optPostfixProjections :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optKeepPatternVariables :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optInferAbsurdClauses :: WithDefault 'True
, PragmaOptions -> Int
_optInstanceSearchDepth :: Int
, PragmaOptions -> WithDefault 'False
_optBacktrackingInstances :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optQualifiedInstances :: WithDefault 'True
, PragmaOptions -> Int
_optInversionMaxDepth :: Int
, PragmaOptions -> WithDefault 'False
_optSafe :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optDoubleCheck :: WithDefault 'False
, PragmaOptions -> Maybe Int
_optSyntacticEquality :: !(Strict.Maybe Int)
, PragmaOptions -> WarningMode
_optWarningMode :: WarningMode
, PragmaOptions -> WithDefault 'True
_optCompileMain :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optCaching :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optCountClusters :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optAutoInline :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optPrintPatternSynonyms :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optFastReduce :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optCallByName :: WithDefault 'False
, PragmaOptions -> Maybe ConfluenceCheck
_optConfluenceCheck :: Maybe ConfluenceCheck
, PragmaOptions -> WithDefault 'False
_optCohesion :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optFlatSplit :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optPolarity :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optImportSorts :: WithDefault 'True
, PragmaOptions -> WithDefault 'True
_optLoadPrimitives :: WithDefault 'True
, PragmaOptions -> WithDefault 'False
_optAllowExec :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optSaveMetas :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optShowIdentitySubstitutions :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optKeepCoveringClauses :: WithDefault 'False
, PragmaOptions -> WithDefault 'False
_optLargeIndices :: WithDefault 'False
, PragmaOptions -> WithDefault 'True
_optForcedArgumentRecursion :: WithDefault 'True
}
deriving (Int -> PragmaOptions -> ShowS
[PragmaOptions] -> ShowS
PragmaOptions -> String
(Int -> PragmaOptions -> ShowS)
-> (PragmaOptions -> String)
-> ([PragmaOptions] -> ShowS)
-> Show PragmaOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PragmaOptions -> ShowS
showsPrec :: Int -> PragmaOptions -> ShowS
$cshow :: PragmaOptions -> String
show :: PragmaOptions -> String
$cshowList :: [PragmaOptions] -> ShowS
showList :: [PragmaOptions] -> ShowS
Show, PragmaOptions -> PragmaOptions -> Bool
(PragmaOptions -> PragmaOptions -> Bool)
-> (PragmaOptions -> PragmaOptions -> Bool) -> Eq PragmaOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PragmaOptions -> PragmaOptions -> Bool
== :: PragmaOptions -> PragmaOptions -> Bool
$c/= :: PragmaOptions -> PragmaOptions -> Bool
/= :: PragmaOptions -> PragmaOptions -> Bool
Eq, (forall x. PragmaOptions -> Rep PragmaOptions x)
-> (forall x. Rep PragmaOptions x -> PragmaOptions)
-> Generic PragmaOptions
forall x. Rep PragmaOptions x -> PragmaOptions
forall x. PragmaOptions -> Rep PragmaOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PragmaOptions -> Rep PragmaOptions x
from :: forall x. PragmaOptions -> Rep PragmaOptions x
$cto :: forall x. Rep PragmaOptions x -> PragmaOptions
to :: forall x. Rep PragmaOptions x -> PragmaOptions
Generic)
data ConfluenceCheck
= LocalConfluenceCheck
| GlobalConfluenceCheck
deriving (Int -> ConfluenceCheck -> ShowS
[ConfluenceCheck] -> ShowS
ConfluenceCheck -> String
(Int -> ConfluenceCheck -> ShowS)
-> (ConfluenceCheck -> String)
-> ([ConfluenceCheck] -> ShowS)
-> Show ConfluenceCheck
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConfluenceCheck -> ShowS
showsPrec :: Int -> ConfluenceCheck -> ShowS
$cshow :: ConfluenceCheck -> String
show :: ConfluenceCheck -> String
$cshowList :: [ConfluenceCheck] -> ShowS
showList :: [ConfluenceCheck] -> ShowS
Show, ConfluenceCheck -> ConfluenceCheck -> Bool
(ConfluenceCheck -> ConfluenceCheck -> Bool)
-> (ConfluenceCheck -> ConfluenceCheck -> Bool)
-> Eq ConfluenceCheck
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConfluenceCheck -> ConfluenceCheck -> Bool
== :: ConfluenceCheck -> ConfluenceCheck -> Bool
$c/= :: ConfluenceCheck -> ConfluenceCheck -> Bool
/= :: ConfluenceCheck -> ConfluenceCheck -> Bool
Eq, (forall x. ConfluenceCheck -> Rep ConfluenceCheck x)
-> (forall x. Rep ConfluenceCheck x -> ConfluenceCheck)
-> Generic ConfluenceCheck
forall x. Rep ConfluenceCheck x -> ConfluenceCheck
forall x. ConfluenceCheck -> Rep ConfluenceCheck x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConfluenceCheck -> Rep ConfluenceCheck x
from :: forall x. ConfluenceCheck -> Rep ConfluenceCheck x
$cto :: forall x. Rep ConfluenceCheck x -> ConfluenceCheck
to :: forall x. Rep ConfluenceCheck x -> ConfluenceCheck
Generic)
data DiagnosticsColours
= AlwaysColour
| NeverColour
| AutoColour
deriving (Int -> DiagnosticsColours -> ShowS
[DiagnosticsColours] -> ShowS
DiagnosticsColours -> String
(Int -> DiagnosticsColours -> ShowS)
-> (DiagnosticsColours -> String)
-> ([DiagnosticsColours] -> ShowS)
-> Show DiagnosticsColours
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiagnosticsColours -> ShowS
showsPrec :: Int -> DiagnosticsColours -> ShowS
$cshow :: DiagnosticsColours -> String
show :: DiagnosticsColours -> String
$cshowList :: [DiagnosticsColours] -> ShowS
showList :: [DiagnosticsColours] -> ShowS
Show, (forall x. DiagnosticsColours -> Rep DiagnosticsColours x)
-> (forall x. Rep DiagnosticsColours x -> DiagnosticsColours)
-> Generic DiagnosticsColours
forall x. Rep DiagnosticsColours x -> DiagnosticsColours
forall x. DiagnosticsColours -> Rep DiagnosticsColours x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DiagnosticsColours -> Rep DiagnosticsColours x
from :: forall x. DiagnosticsColours -> Rep DiagnosticsColours x
$cto :: forall x. Rep DiagnosticsColours x -> DiagnosticsColours
to :: forall x. Rep DiagnosticsColours x -> DiagnosticsColours
Generic)
data InfectiveCoinfective
= Infective
| Coinfective
deriving (InfectiveCoinfective -> InfectiveCoinfective -> Bool
(InfectiveCoinfective -> InfectiveCoinfective -> Bool)
-> (InfectiveCoinfective -> InfectiveCoinfective -> Bool)
-> Eq InfectiveCoinfective
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InfectiveCoinfective -> InfectiveCoinfective -> Bool
== :: InfectiveCoinfective -> InfectiveCoinfective -> Bool
$c/= :: InfectiveCoinfective -> InfectiveCoinfective -> Bool
/= :: InfectiveCoinfective -> InfectiveCoinfective -> Bool
Eq, Int -> InfectiveCoinfective -> ShowS
[InfectiveCoinfective] -> ShowS
InfectiveCoinfective -> String
(Int -> InfectiveCoinfective -> ShowS)
-> (InfectiveCoinfective -> String)
-> ([InfectiveCoinfective] -> ShowS)
-> Show InfectiveCoinfective
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InfectiveCoinfective -> ShowS
showsPrec :: Int -> InfectiveCoinfective -> ShowS
$cshow :: InfectiveCoinfective -> String
show :: InfectiveCoinfective -> String
$cshowList :: [InfectiveCoinfective] -> ShowS
showList :: [InfectiveCoinfective] -> ShowS
Show, (forall x. InfectiveCoinfective -> Rep InfectiveCoinfective x)
-> (forall x. Rep InfectiveCoinfective x -> InfectiveCoinfective)
-> Generic InfectiveCoinfective
forall x. Rep InfectiveCoinfective x -> InfectiveCoinfective
forall x. InfectiveCoinfective -> Rep InfectiveCoinfective x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InfectiveCoinfective -> Rep InfectiveCoinfective x
from :: forall x. InfectiveCoinfective -> Rep InfectiveCoinfective x
$cto :: forall x. Rep InfectiveCoinfective x -> InfectiveCoinfective
to :: forall x. Rep InfectiveCoinfective x -> InfectiveCoinfective
Generic)
data PrintAgdaVersion
= PrintAgdaVersion
| PrintAgdaNumericVersion
deriving (Int -> PrintAgdaVersion -> ShowS
[PrintAgdaVersion] -> ShowS
PrintAgdaVersion -> String
(Int -> PrintAgdaVersion -> ShowS)
-> (PrintAgdaVersion -> String)
-> ([PrintAgdaVersion] -> ShowS)
-> Show PrintAgdaVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrintAgdaVersion -> ShowS
showsPrec :: Int -> PrintAgdaVersion -> ShowS
$cshow :: PrintAgdaVersion -> String
show :: PrintAgdaVersion -> String
$cshowList :: [PrintAgdaVersion] -> ShowS
showList :: [PrintAgdaVersion] -> ShowS
Show, (forall x. PrintAgdaVersion -> Rep PrintAgdaVersion x)
-> (forall x. Rep PrintAgdaVersion x -> PrintAgdaVersion)
-> Generic PrintAgdaVersion
forall x. Rep PrintAgdaVersion x -> PrintAgdaVersion
forall x. PrintAgdaVersion -> Rep PrintAgdaVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PrintAgdaVersion -> Rep PrintAgdaVersion x
from :: forall x. PrintAgdaVersion -> Rep PrintAgdaVersion x
$cto :: forall x. Rep PrintAgdaVersion x -> PrintAgdaVersion
to :: forall x. Rep PrintAgdaVersion x -> PrintAgdaVersion
Generic)
type VerboseKey = String
type VerboseKeyItem = String1
type VerboseLevel = Int
type Verbosity = Strict.Maybe (Trie VerboseKeyItem VerboseLevel)
class LensPragmaOptions a where
getPragmaOptions :: a -> PragmaOptions
setPragmaOptions :: PragmaOptions -> a -> a
mapPragmaOptions :: (PragmaOptions -> PragmaOptions) -> a -> a
lensPragmaOptions :: Lens' a PragmaOptions
{-# MINIMAL lensPragmaOptions #-}
getPragmaOptions = (a -> Lens' a PragmaOptions -> PragmaOptions
forall o i. o -> Lens' o i -> i
^. (PragmaOptions -> f PragmaOptions) -> a -> f a
forall a. LensPragmaOptions a => Lens' a PragmaOptions
Lens' a PragmaOptions
lensPragmaOptions)
setPragmaOptions = (PragmaOptions -> PragmaOptions) -> a -> a
forall a.
LensPragmaOptions a =>
(PragmaOptions -> PragmaOptions) -> a -> a
mapPragmaOptions ((PragmaOptions -> PragmaOptions) -> a -> a)
-> (PragmaOptions -> PragmaOptions -> PragmaOptions)
-> PragmaOptions
-> a
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PragmaOptions -> PragmaOptions -> PragmaOptions
forall a b. a -> b -> a
const
mapPragmaOptions = Lens' a PragmaOptions -> (PragmaOptions -> PragmaOptions) -> a -> a
forall o i. Lens' o i -> LensMap o i
over (PragmaOptions -> f PragmaOptions) -> a -> f a
forall a. LensPragmaOptions a => Lens' a PragmaOptions
Lens' a PragmaOptions
lensPragmaOptions
instance LensPragmaOptions CommandLineOptions where
lensPragmaOptions :: Lens' CommandLineOptions PragmaOptions
lensPragmaOptions PragmaOptions -> f PragmaOptions
f CommandLineOptions
st = PragmaOptions -> f PragmaOptions
f (CommandLineOptions -> PragmaOptions
optPragmaOptions CommandLineOptions
st) f PragmaOptions
-> (PragmaOptions -> CommandLineOptions) -> f CommandLineOptions
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \ PragmaOptions
opts -> CommandLineOptions
st { optPragmaOptions = opts }
instance NFData CommandLineOptions
instance NFData PragmaOptions
instance NFData ConfluenceCheck
instance NFData DiagnosticsColours
instance NFData InfectiveCoinfective
instance NFData PrintAgdaVersion