Safe Haskell | None |
---|---|
Language | Haskell98 |
Agda.TypeChecking.Monad.Base
Contents
- data TCState = TCSt {
- stFreshThings :: FreshThings
- stSyntaxInfo :: CompressedFile
- stTokens :: CompressedFile
- stTermErrs :: Seq TerminationError
- stMetaStore :: MetaStore
- stInteractionPoints :: InteractionPoints
- stAwakeConstraints :: Constraints
- stSleepingConstraints :: Constraints
- stDirty :: Bool
- stOccursCheckDefs :: Set QName
- stSignature :: Signature
- stImports :: Signature
- stImportedModules :: Set ModuleName
- stModuleToSource :: ModuleToSource
- stVisitedModules :: VisitedModules
- stCurrentModule :: Maybe ModuleName
- stScope :: ScopeInfo
- stPatternSyns :: PatternSynDefns
- stPatternSynImports :: PatternSynDefns
- stPragmaOptions :: PragmaOptions
- stStatistics :: Statistics
- stMutualBlocks :: Map MutualId (Set QName)
- stLocalBuiltins :: BuiltinThings PrimFun
- stImportedBuiltins :: BuiltinThings PrimFun
- stHaskellImports :: Set String
- stPersistent :: PersistentTCState
- data PersistentTCState = PersistentTCSt {}
- initPersistentState :: PersistentTCState
- data FreshThings = Fresh {}
- initState :: TCState
- stBuiltinThings :: TCState -> BuiltinThings PrimFun
- newtype ProblemId = ProblemId Nat
- type ModuleToSource = Map TopLevelModuleName AbsolutePath
- type SourceToModule = Map AbsolutePath TopLevelModuleName
- sourceToModule :: TCM SourceToModule
- data ModuleInfo = ModuleInfo {}
- type VisitedModules = Map TopLevelModuleName ModuleInfo
- type DecodedModules = Map TopLevelModuleName Interface
- data Interface = Interface {
- iSourceHash :: Hash
- iImportedModules :: [(ModuleName, Hash)]
- iModuleName :: ModuleName
- iScope :: Map ModuleName Scope
- iInsideScope :: ScopeInfo
- iSignature :: Signature
- iBuiltin :: BuiltinThings (String, QName)
- iHaskellImports :: Set String
- iHighlighting :: HighlightingInfo
- iPragmaOptions :: [OptionsPragma]
- iPatternSyns :: PatternSynDefns
- iFullHash :: Interface -> Hash
- data Closure a = Closure {}
- buildClosure :: a -> TCM (Closure a)
- type Constraints = [ProblemConstraint]
- data ProblemConstraint = PConstr {}
- data Constraint
- = ValueCmp Comparison Type Term Term
- | ElimCmp [Polarity] Type Term [Elim] [Elim]
- | TypeCmp Comparison Type Type
- | TelCmp Type Type Comparison Telescope Telescope
- | SortCmp Comparison Sort Sort
- | LevelCmp Comparison Level Level
- | UnBlock MetaId
- | Guarded Constraint ProblemId
- | IsEmpty Range Type
- | FindInScope MetaId [(Term, Type)]
- data Comparison
- data CompareDirection
- fromCmp :: Comparison -> CompareDirection
- flipCmp :: CompareDirection -> CompareDirection
- dirToCmp :: (Comparison -> a -> a -> c) -> CompareDirection -> a -> a -> c
- data Open a = OpenThing {
- openThingCtxIds :: [CtxId]
- openThing :: a
- data Judgement t a
- data MetaVariable = MetaVar {}
- data Listener
- data Frozen
- data MetaInstantiation
- data TypeCheckingProblem
- newtype MetaPriority = MetaPriority Int
- data RunMetaOccursCheck
- data MetaInfo = MetaInfo {}
- type MetaNameSuggestion = String
- data NamedMeta = NamedMeta {}
- type MetaStore = Map MetaId MetaVariable
- normalMetaPriority :: MetaPriority
- lowMetaPriority :: MetaPriority
- highMetaPriority :: MetaPriority
- getMetaInfo :: MetaVariable -> Closure Range
- getMetaScope :: MetaVariable -> ScopeInfo
- getMetaEnv :: MetaVariable -> TCEnv
- getMetaSig :: MetaVariable -> Signature
- getMetaRelevance :: MetaVariable -> Relevance
- getMetaColors :: MetaVariable -> [Color]
- data InteractionPoint = InteractionPoint {}
- type InteractionPoints = Map InteractionId InteractionPoint
- data Signature = Sig {}
- type Sections = Map ModuleName Section
- type Definitions = HashMap QName Definition
- data Section = Section {}
- emptySignature :: Signature
- data DisplayForm = Display {
- dfFreeVars :: Nat
- dfPats :: [Term]
- dfRHS :: DisplayTerm
- data DisplayTerm
- = DWithApp DisplayTerm [DisplayTerm] Args
- | DCon QName [Arg DisplayTerm]
- | DDef QName [Arg DisplayTerm]
- | DDot Term
- | DTerm Term
- defaultDisplayForm :: QName -> [Open DisplayForm]
- defRelevance :: Definition -> Relevance
- defColors :: Definition -> [Color]
- data Definition = Defn {}
- defaultDefn :: ArgInfo -> QName -> Type -> Defn -> Definition
- type HaskellCode = String
- type HaskellType = String
- type EpicCode = String
- type JSCode = Exp
- data HaskellRepresentation
- data HaskellExport = HsExport HaskellType String
- data Polarity
- data CompiledRepresentation = CompiledRep {}
- noCompiledRep :: CompiledRepresentation
- data Occurrence
- data Projection = Projection {
- projProper :: Maybe QName
- projFromType :: QName
- projIndex :: Int
- projDropPars :: Term
- projArgInfo :: ArgInfo
- data Defn
- = Axiom
- | Function {
- funClauses :: [Clause]
- funCompiled :: Maybe CompiledClauses
- funInv :: FunctionInverse
- funMutual :: [QName]
- funAbstr :: IsAbstract
- funDelayed :: Delayed
- funProjection :: Maybe Projection
- funStatic :: Bool
- funCopy :: Bool
- funTerminates :: Maybe Bool
- funExtLam :: Maybe (Int, Int)
- funWith :: Maybe QName
- | Datatype {
- dataPars :: Nat
- dataSmallPars :: Permutation
- dataNonLinPars :: Drop Permutation
- dataIxs :: Nat
- dataInduction :: Induction
- dataClause :: Maybe Clause
- dataCons :: [QName]
- dataSort :: Sort
- dataMutual :: [QName]
- dataAbstr :: IsAbstract
- | Record {
- recPars :: Nat
- recClause :: Maybe Clause
- recConHead :: ConHead
- recNamedCon :: Bool
- recConType :: Type
- recFields :: [Arg QName]
- recTel :: Telescope
- recMutual :: [QName]
- recEtaEquality :: Bool
- recInduction :: Induction
- recRecursive :: Bool
- recAbstr :: IsAbstract
- | Constructor { }
- | Primitive { }
- emptyFunction :: Defn
- recCon :: Defn -> QName
- defIsRecord :: Defn -> Bool
- defIsDataOrRecord :: Defn -> Bool
- newtype Fields = Fields [(Name, Type)]
- data Simplification
- data Reduced no yes
- = NoReduction no
- | YesReduction Simplification yes
- data IsReduced
- = NotReduced
- | Reduced (Blocked ())
- data MaybeReduced a = MaybeRed {
- isReduced :: IsReduced
- ignoreReduced :: a
- type MaybeReducedArgs = [MaybeReduced (Arg Term)]
- type MaybeReducedElims = [MaybeReduced Elim]
- notReduced :: a -> MaybeReduced a
- reduced :: Blocked (Arg Term) -> MaybeReduced (Arg Term)
- data AllowedReduction
- type AllowedReductions = [AllowedReduction]
- allReductions :: [AllowedReduction]
- data PrimFun = PrimFun {
- primFunName :: QName
- primFunArity :: Arity
- primFunImplementation :: [Arg Term] -> ReduceM (Reduced MaybeReducedArgs Term)
- defClauses :: Definition -> [Clause]
- defCompiled :: Definition -> Maybe CompiledClauses
- defJSDef :: Definition -> Maybe JSCode
- defEpicDef :: Definition -> Maybe EpicCode
- defDelayed :: Definition -> Delayed
- defNonterminating :: Definition -> Bool
- defCopy :: Definition -> Bool
- defAbstract :: Definition -> IsAbstract
- type FunctionInverse = FunctionInverse' Clause
- data FunctionInverse' c
- = NotInjective
- | Inverse (Map TermHead c)
- data TermHead
- newtype MutualId = MutId Int32
- type Statistics = Map String Integer
- data Call
- = CheckClause Type SpineClause (Maybe Clause)
- | forall a . CheckPattern Pattern Telescope Type (Maybe a)
- | CheckLetBinding LetBinding (Maybe ())
- | InferExpr Expr (Maybe (Term, Type))
- | CheckExprCall Expr Type (Maybe Term)
- | CheckDotPattern Expr Term (Maybe Constraints)
- | CheckPatternShadowing SpineClause (Maybe ())
- | IsTypeCall Expr Sort (Maybe Type)
- | IsType_ Expr (Maybe Type)
- | InferVar Name (Maybe (Term, Type))
- | InferDef Range QName (Maybe (Term, Type))
- | CheckArguments Range [NamedArg Expr] Type Type (Maybe (Args, Type))
- | CheckDataDef Range Name [LamBinding] [Constructor] (Maybe ())
- | CheckRecDef Range Name [LamBinding] [Constructor] (Maybe ())
- | CheckConstructor QName Telescope Sort Constructor (Maybe ())
- | CheckFunDef Range Name [Clause] (Maybe ())
- | CheckPragma Range Pragma (Maybe ())
- | CheckPrimitive Range Name Expr (Maybe ())
- | CheckIsEmpty Range Type (Maybe ())
- | CheckWithFunctionType Expr (Maybe ())
- | CheckSectionApplication Range ModuleName ModuleApplication (Maybe ())
- | ScopeCheckExpr Expr (Maybe Expr)
- | ScopeCheckDeclaration NiceDeclaration (Maybe [Declaration])
- | ScopeCheckLHS Name Pattern (Maybe LHS)
- | forall a . NoHighlighting (Maybe a)
- | forall a . SetRange Range (Maybe a)
- data BuiltinDescriptor
- = BuiltinData (TCM Type) [String]
- | BuiltinDataCons (TCM Type)
- | BuiltinPrim String (Term -> TCM ())
- | BuiltinPostulate Relevance (TCM Type)
- | BuiltinUnknown (Maybe (TCM Type)) (Term -> Type -> TCM ())
- data BuiltinInfo = BuiltinInfo {}
- type BuiltinThings pf = Map String (Builtin pf)
- data Builtin pf
- data HighlightingLevel
- data HighlightingMethod
- ifTopLevelAndHighlightingLevelIs :: MonadTCM tcm => HighlightingLevel -> tcm () -> tcm ()
- data TCEnv = TCEnv {
- envContext :: Context
- envLetBindings :: LetBindings
- envCurrentModule :: ModuleName
- envCurrentPath :: AbsolutePath
- envAnonymousModules :: [(ModuleName, Nat)]
- envImportPath :: [TopLevelModuleName]
- envMutualBlock :: Maybe MutualId
- envSolvingConstraints :: Bool
- envAssignMetas :: Bool
- envActiveProblems :: [ProblemId]
- envAbstractMode :: AbstractMode
- envRelevance :: Relevance
- envColors :: [Color]
- envDisplayFormsEnabled :: Bool
- envReifyInteractionPoints :: Bool
- envEtaContractImplicit :: Bool
- envRange :: Range
- envHighlightingRange :: Range
- envCall :: Maybe (Closure Call)
- envHighlightingLevel :: HighlightingLevel
- envHighlightingMethod :: HighlightingMethod
- envModuleNestingLevel :: Integer
- envAllowDestructiveUpdate :: Bool
- envExpandLast :: ExpandHidden
- envAppDef :: Maybe QName
- envSimplification :: Simplification
- envAllowedReductions :: AllowedReductions
- envPrintDomainFreePi :: Bool
- envInsideDotPattern :: Bool
- initEnv :: TCEnv
- type Context = [ContextEntry]
- data ContextEntry = Ctx {}
- newtype CtxId = CtxId Nat
- type LetBindings = Map Name (Open (Term, Dom Type))
- data AbstractMode
- data ExpandHidden
- data ExpandInstances
- data Occ
- = OccCon { }
- | OccClause {
- occFunction :: QName
- occClause :: Int
- occPosition :: OccPos
- data OccPos
- data CallInfo = CallInfo {}
- data TerminationError = TerminationError {
- termErrFunctions :: [QName]
- termErrCalls :: [CallInfo]
- data SplitError
- data TypeError
- = InternalError String
- | NotImplemented String
- | NotSupported String
- | CompilationError String
- | TerminationCheckFailed [TerminationError]
- | PropMustBeSingleton
- | DataMustEndInSort Term
- | ShouldEndInApplicationOfTheDatatype Type
- | ShouldBeAppliedToTheDatatypeParameters Term Term
- | ShouldBeApplicationOf Type QName
- | ConstructorPatternInWrongDatatype QName QName
- | IndicesNotConstructorApplications [Arg Term]
- | IndexVariablesNotDistinct [Nat] [Arg Term]
- | IndicesFreeInParameters [Nat] [Arg Term] [Arg Term]
- | CantResolveOverloadedConstructorsTargetingSameDatatype QName [QName]
- | DoesNotConstructAnElementOf QName Type
- | DifferentArities
- | WrongHidingInLHS
- | WrongHidingInLambda Type
- | WrongHidingInApplication Type
- | WrongNamedArgument (NamedArg Expr)
- | WrongIrrelevanceInLambda Type
- | HidingMismatch Hiding Hiding
- | RelevanceMismatch Relevance Relevance
- | ColorMismatch [Color] [Color]
- | NotInductive Term
- | UninstantiatedDotPattern Expr
- | IlltypedPattern Pattern Type
- | IllformedProjectionPattern Pattern
- | CannotEliminateWithPattern (NamedArg Pattern) Type
- | TooManyArgumentsInLHS Type
- | WrongNumberOfConstructorArguments QName Nat Nat
- | ShouldBeEmpty Type [Pattern]
- | ShouldBeASort Type
- | ShouldBePi Type
- | ShouldBeRecordType Type
- | ShouldBeRecordPattern Pattern
- | NotAProjectionPattern (NamedArg Pattern)
- | NotAProperTerm
- | SetOmegaNotValidType
- | InvalidType Term
- | SplitOnIrrelevant Pattern (Dom Type)
- | DefinitionIsIrrelevant QName
- | VariableIsIrrelevant Name
- | UnequalTerms Comparison Term Term Type
- | UnequalTypes Comparison Type Type
- | UnequalRelevance Comparison Term Term
- | UnequalHiding Term Term
- | UnequalColors Term Term
- | UnequalSorts Sort Sort
- | UnequalBecauseOfUniverseConflict Comparison Term Term
- | HeterogeneousEquality Term Type Term Type
- | NotLeqSort Sort Sort
- | MetaCannotDependOn MetaId [Nat] Nat
- | MetaOccursInItself MetaId
- | GenericError String
- | GenericDocError Doc
- | BuiltinMustBeConstructor String Expr
- | NoSuchBuiltinName String
- | DuplicateBuiltinBinding String Term Term
- | NoBindingForBuiltin String
- | NoSuchPrimitiveFunction String
- | ShadowedModule Name [ModuleName]
- | BuiltinInParameterisedModule String
- | IllegalLetInTelescope TypedBinding
- | NoRHSRequiresAbsurdPattern [NamedArg Pattern]
- | AbsurdPatternRequiresNoRHS [NamedArg Pattern]
- | TooFewFields QName [Name]
- | TooManyFields QName [Name]
- | DuplicateFields [Name]
- | DuplicateConstructors [Name]
- | UnexpectedWithPatterns [Pattern]
- | WithClausePatternMismatch Pattern Pattern
- | FieldOutsideRecord
- | ModuleArityMismatch ModuleName Telescope [NamedArg Expr]
- | IncompletePatternMatching Term [Elim]
- | CoverageFailure QName [[Arg Pattern]]
- | UnreachableClauses QName [[Arg Pattern]]
- | CoverageCantSplitOn QName Telescope Args Args
- | CoverageCantSplitIrrelevantType Type
- | CoverageCantSplitType Type
- | WithoutKError Type Term Term
- | SplitError SplitError
- | NotStrictlyPositive QName [Occ]
- | LocalVsImportedModuleClash ModuleName
- | UnsolvedMetas [Range]
- | UnsolvedConstraints Constraints
- | CyclicModuleDependency [TopLevelModuleName]
- | FileNotFound TopLevelModuleName [AbsolutePath]
- | OverlappingProjects AbsolutePath TopLevelModuleName TopLevelModuleName
- | AmbiguousTopLevelModuleName TopLevelModuleName [AbsolutePath]
- | ModuleNameDoesntMatchFileName TopLevelModuleName [AbsolutePath]
- | ClashingFileNamesFor ModuleName [AbsolutePath]
- | ModuleDefinedInOtherFile TopLevelModuleName AbsolutePath AbsolutePath
- | BothWithAndRHS
- | NotInScope [QName]
- | NoSuchModule QName
- | AmbiguousName QName [QName]
- | AmbiguousModule QName [ModuleName]
- | UninstantiatedModule QName
- | ClashingDefinition QName QName
- | ClashingModule ModuleName ModuleName
- | ClashingImport Name QName
- | ClashingModuleImport Name ModuleName
- | PatternShadowsConstructor Name QName
- | ModuleDoesntExport QName [ImportedName]
- | DuplicateImports QName [ImportedName]
- | InvalidPattern Pattern
- | RepeatedVariablesInPattern [Name]
- | NotAModuleExpr Expr
- | NotAnExpression Expr
- | NotAValidLetBinding NiceDeclaration
- | NothingAppliedToHiddenArg Expr
- | NothingAppliedToInstanceArg Expr
- | UnusedVariableInPatternSynonym
- | PatternSynonymArityMismatch QName
- | NoParseForApplication [Expr]
- | AmbiguousParseForApplication [Expr] [Expr]
- | NoParseForLHS LHSOrPatSyn Pattern
- | AmbiguousParseForLHS LHSOrPatSyn Pattern [Pattern]
- | IFSNoCandidateInScope Type
- | SafeFlagPostulate Name
- | SafeFlagPragma [String]
- | SafeFlagNoTerminationCheck
- | SafeFlagPrimTrustMe
- | NeedOptionCopatterns
- data LHSOrPatSyn
- data TCErr
- data ReduceEnv = ReduceEnv {}
- mapRedEnv :: (TCEnv -> TCEnv) -> ReduceEnv -> ReduceEnv
- mapRedSt :: (TCState -> TCState) -> ReduceEnv -> ReduceEnv
- mapRedEnvSt :: (TCEnv -> TCEnv) -> (TCState -> TCState) -> ReduceEnv -> ReduceEnv
- newtype ReduceM a = ReduceM {}
- runReduceM :: ReduceM a -> TCM a
- newtype TCMT m a = TCM {}
- type TCM = TCMT IO
- class (Applicative tcm, MonadIO tcm, MonadReader TCEnv tcm, MonadState TCState tcm) => MonadTCM tcm where
- catchError_ :: TCM a -> (TCErr -> TCM a) -> TCM a
- mapTCMT :: (forall a. m a -> n a) -> TCMT m a -> TCMT n a
- pureTCM :: MonadIO m => (TCState -> TCEnv -> a) -> TCMT m a
- returnTCMT :: MonadIO m => a -> TCMT m a
- bindTCMT :: MonadIO m => TCMT m a -> (a -> TCMT m b) -> TCMT m b
- thenTCMT :: MonadIO m => TCMT m a -> TCMT m b -> TCMT m b
- fmapTCMT :: MonadIO m => (a -> b) -> TCMT m a -> TCMT m b
- apTCMT :: MonadIO m => TCMT m (a -> b) -> TCMT m a -> TCMT m b
- patternViolation :: TCM a
- internalError :: MonadTCM tcm => String -> tcm a
- typeError :: MonadTCM tcm => TypeError -> tcm a
- runTCM :: MonadIO m => TCEnv -> TCState -> TCMT m a -> m (a, TCState)
- runTCMTop :: TCM a -> IO (Either TCErr a)
- runTCMTop' :: MonadIO m => TCMT m a -> m a
- runSafeTCM :: TCM a -> TCState -> IO (a, TCState)
- forkTCM :: TCM a -> TCM ()
- extendlambdaname :: [Char]
- absurdLambdaName :: [Char]
- isAbsurdLambdaName :: QName -> Bool
Type checking state
data TCState
Constructors
TCSt | |
Fields
|
data PersistentTCState
A part of the state which is not reverted when an error is thrown or the state is reset.
Constructors
PersistentTCSt | |
Fields
|
initPersistentState :: PersistentTCState
Empty persistent state.
data FreshThings
Constructors
Fresh | |
newtype ProblemId
Managing file names
type ModuleToSource = Map TopLevelModuleName AbsolutePath
Maps top-level module names to the corresponding source file names.
type SourceToModule = Map AbsolutePath TopLevelModuleName
Maps source file names to the corresponding top-level module names.
sourceToModule :: TCM SourceToModule
Creates a SourceToModule
map based on stModuleToSource
.
Interface
data ModuleInfo
Constructors
ModuleInfo | |
Fields
|
data Interface
Constructors
Interface | |
Fields
|
iFullHash :: Interface -> Hash
Combines the source hash and the (full) hashes of the imported modules.
Closure
data Closure a
Instances
Reify ProblemConstraint (Closure (OutputForm Expr Expr)) | |
Show a => Show (Closure a) | |
HasRange a => HasRange (Closure a) | |
PrettyTCM a => PrettyTCM (Closure a) | |
MentionsMeta a => MentionsMeta (Closure a) | |
InstantiateFull a => InstantiateFull (Closure a) | |
Normalise a => Normalise (Closure a) | |
Simplify a => Simplify (Closure a) | |
Reduce a => Reduce (Closure a) | |
Instantiate a => Instantiate (Closure a) | |
Typeable (* -> *) Closure |
buildClosure :: a -> TCM (Closure a)
Constraints
type Constraints = [ProblemConstraint]
data ProblemConstraint
Constructors
PConstr | |
Fields |
data Constraint
Constructors
ValueCmp Comparison Type Term Term | |
ElimCmp [Polarity] Type Term [Elim] [Elim] | |
TypeCmp Comparison Type Type | |
TelCmp Type Type Comparison Telescope Telescope | the two types are for the error message only |
SortCmp Comparison Sort Sort | |
LevelCmp Comparison Level Level | |
UnBlock MetaId | |
Guarded Constraint ProblemId | |
IsEmpty Range Type | the range is the one of the absurd pattern |
FindInScope MetaId [(Term, Type)] |
data Comparison
Instances
fromCmp :: Comparison -> CompareDirection
Embed Comparison
into CompareDirection
.
flipCmp :: CompareDirection -> CompareDirection
Flip the direction of comparison.
dirToCmp :: (Comparison -> a -> a -> c) -> CompareDirection -> a -> a -> c
Turn a Comparison
function into a CompareDirection
function.
Property: dirToCmp f (fromCmp cmp) = f cmp
Open things
data Open a
A thing tagged with the context it came from.
Constructors
OpenThing | |
Fields
|
Judgements
data Judgement t a
Meta variables
data MetaVariable
Constructors
MetaVar | |
Fields
|
Instances
data Listener
Constructors
EtaExpand MetaId | |
CheckConstraint Nat ProblemConstraint |
data Frozen
Frozen meta variable cannot be instantiated by unification. This serves to prevent the completion of a definition by its use outside of the current block. (See issues 118, 288, 399).
Constructors
Frozen | Do not instantiate. |
Instantiable |
data MetaInstantiation
Constructors
InstV Term | solved by term |
InstS Term | solved by |
Open | unsolved |
OpenIFS | open, to be instantiated as "implicit from scope" |
BlockedConst Term | solution blocked by unsolved constraints |
PostponedTypeCheckingProblem (Closure TypeCheckingProblem) (TCM Bool) |
Instances
data TypeCheckingProblem
Constructors
CheckExpr Expr Type | |
CheckArgs ExpandHidden ExpandInstances Range [NamedArg Expr] Type Type (Args -> Type -> TCM Term) |
Instances
newtype MetaPriority
Meta variable priority: When we have an equation between meta-variables, which one should be instantiated?
Higher value means higher priority to be instantiated.
Constructors
MetaPriority Int |
Instances
data RunMetaOccursCheck
Constructors
RunMetaOccursCheck | |
DontRunMetaOccursCheck |
data MetaInfo
MetaInfo
is cloned from one meta to the next during pruning.
Constructors
MetaInfo | |
Fields
|
type MetaNameSuggestion = String
Name suggestion for meta variable. Empty string means no suggestion.
data NamedMeta
For printing, we couple a meta with its name suggestion.
Constructors
NamedMeta | |
Fields |
Instances
type MetaStore = Map MetaId MetaVariable
getMetaInfo :: MetaVariable -> Closure Range
getMetaEnv :: MetaVariable -> TCEnv
getMetaSig :: MetaVariable -> Signature
getMetaColors :: MetaVariable -> [Color]
Interaction meta variables
data InteractionPoint
Interaction points are created by the scope checker who sets the range. The meta variable is created by the type checker and then hooked up to the interaction point.
Constructors
InteractionPoint | |
Instances
type InteractionPoints = Map InteractionId InteractionPoint
Data structure managing the interaction points.
Signature
type Sections = Map ModuleName Section
type Definitions = HashMap QName Definition
data Section
Constructors
Section | |
Fields
|
data DisplayForm
A DisplayForm
is in essence a rewrite rule
q ts --> dt
for a defined symbol (could be a constructor as well) q
.
The right hand side is a DisplayTerm
which is used to
reify
to a more readable Syntax
.
The patterns ts
are just terms, but var 0
is interpreted
as a hole. Each occurrence of var 0
is a new hole (pattern var).
For each *occurrence* of var0
the rhs dt
has a free variable.
These are instantiated when matching a display form against a
term q vs
succeeds.
Constructors
Display | |
Fields
|
data DisplayTerm
Constructors
DWithApp DisplayTerm [DisplayTerm] Args |
|
DCon QName [Arg DisplayTerm] |
|
DDef QName [Arg DisplayTerm] |
|
DDot Term |
|
DTerm Term |
|
defaultDisplayForm :: QName -> [Open DisplayForm]
By default, we have no display form.
defRelevance :: Definition -> Relevance
defColors :: Definition -> [Color]
data Definition
Constructors
Defn | |
Fields
|
defaultDefn :: ArgInfo -> QName -> Type -> Defn -> Definition
Create a definition with sensible defaults.
type HaskellCode = String
type HaskellType = String
Constructors
HsDefn HaskellType HaskellCode | |
HsType HaskellType |
data Polarity
Polarity for equality and subtype checking.
Constructors
Covariant | monotone |
Contravariant | antitone |
Invariant | no information (mixed variance) |
Nonvariant | constant |
Constructors
CompiledRep | |
data Occurrence
Subterm occurrences for positivity checking.
The constructors are listed in increasing information they provide:
Mixed <= JustPos <= StrictPos <= GuardPos <= Unused
Mixed <= JustNeg <= Unused
.
Constructors
Mixed | Arbitrary occurrence (positive and negative). |
JustNeg | Negative occurrence. |
JustPos | Positive occurrence, but not strictly positive. |
StrictPos | Strictly positive occurrence. |
GuardPos | Guarded strictly positive occurrence (i.e., under ∞). For checking recursive records. |
Unused |
Instances
Eq Occurrence | |
Ord Occurrence | |
Show Occurrence | |
NFData Occurrence | |
SemiRing Occurrence |
It forms a commutative semiring where For |
KillRange Occurrence | |
PrettyTCM Occurrence | |
EmbPrj Occurrence | |
Typeable * Occurrence | |
Abstract [Occurrence] | |
Apply [Occurrence] | |
PrettyTCM n => PrettyTCM (WithNode n Occurrence) |
data Projection
Additional information for projection Function
s.
Constructors
Projection | |
Fields
|
data Defn
Constructors
Axiom | Postulate. |
Function | |
Fields
| |
Datatype | |
Fields
| |
Record | |
Fields
| |
Constructor | |
Primitive | Primitive or builtin functions. |
Fields
|
A template for creating Function
definitions, with sensible defaults.
defIsRecord :: Defn -> Bool
defIsDataOrRecord :: Defn -> Bool
data Simplification
Did we encounter a simplifying reduction? In terms of CIC, that would be a iota-reduction. In terms of Agda, this is a constructor or literal pattern that matched. Just beta-reduction (substitution) or delta-reduction (unfolding of definitions) does not count as simplifying?
Constructors
YesSimplification | |
NoSimplification |
data Reduced no yes
Constructors
NoReduction no | |
YesReduction Simplification yes |
data IsReduced
Three cases: 1. not reduced, 2. reduced, but blocked, 3. reduced, not blocked.
Constructors
NotReduced | |
Reduced (Blocked ()) |
data MaybeReduced a
Constructors
MaybeRed | |
Fields
|
Instances
Functor MaybeReduced | |
IsProjElim e => IsProjElim (MaybeReduced e) | |
PrettyTCM a => PrettyTCM (MaybeReduced a) |
type MaybeReducedArgs = [MaybeReduced (Arg Term)]
type MaybeReducedElims = [MaybeReduced Elim]
notReduced :: a -> MaybeReduced a
data AllowedReduction
Controlling reduce
.
Constructors
ProjectionReductions | (Projection and) projection-like functions may be reduced. |
FunctionReductions | Functions which are not projections may be reduced. |
LevelReductions | Reduce |
type AllowedReductions = [AllowedReduction]
data PrimFun
Constructors
PrimFun | |
Fields
|
defClauses :: Definition -> [Clause]
defJSDef :: Definition -> Maybe JSCode
defEpicDef :: Definition -> Maybe EpicCode
defDelayed :: Definition -> Delayed
Are the clauses of this definition delayed?
defNonterminating :: Definition -> Bool
Has the definition failed the termination checker?
defCopy :: Definition -> Bool
Is the definition just a copy created by a module instantiation?
defAbstract :: Definition -> IsAbstract
Injectivity
data FunctionInverse' c
Constructors
NotInjective | |
Inverse (Map TermHead c) |
data TermHead
Mutual blocks
newtype MutualId
Statistics
type Statistics = Map String Integer
Trace
data Call
Constructors
Builtin things
data BuiltinDescriptor
Constructors
BuiltinData (TCM Type) [String] | |
BuiltinDataCons (TCM Type) | |
BuiltinPrim String (Term -> TCM ()) | |
BuiltinPostulate Relevance (TCM Type) | |
BuiltinUnknown (Maybe (TCM Type)) (Term -> Type -> TCM ()) | Builtin of any kind.
Type can be checked ( |
data BuiltinInfo
Constructors
BuiltinInfo | |
Fields |
type BuiltinThings pf = Map String (Builtin pf)
data Builtin pf
Highlighting levels
data HighlightingLevel
How much highlighting should be sent to the user interface?
Constructors
None | |
NonInteractive | |
Interactive | This includes both non-interactive highlighting and interactive highlighting of the expression that is currently being type-checked. |
data HighlightingMethod
How should highlighting be sent to the user interface?
ifTopLevelAndHighlightingLevelIs :: MonadTCM tcm => HighlightingLevel -> tcm () -> tcm ()
ifTopLevelAndHighlightingLevelIs l m
runs m
when we're
type-checking the top-level module and the highlighting level is
at least l
.
Type checking environment
data TCEnv
Constructors
TCEnv | |
Fields
|
Instances
Context
type Context = [ContextEntry]
The Context
is a stack of ContextEntry
s.
data ContextEntry
Instances
newtype CtxId
Let bindings
Abstract mode
data AbstractMode
Constructors
AbstractMode | Abstract things in the current module can be accessed. |
ConcreteMode | No abstract things can be accessed. |
IgnoreAbstractMode | All abstract things can be accessed. |
Instances
Insertion of implicit arguments
data ExpandHidden
Constructors
ExpandLast | Add implicit arguments in the end until type is no longer hidden |
DontExpandLast | Do not append implicit arguments. |
Instances
Type checking errors
data Occ
Constructors
OccCon | |
Fields
| |
OccClause | |
Fields
|
data CallInfo
Information about a call.
Constructors
CallInfo | |
Fields
|
data TerminationError
Information about a mutual block which did not pass the termination checker.
Constructors
TerminationError | |
Fields
|
Instances
data SplitError
Constructors
NotADatatype (Closure Type) | neither data type nor record |
IrrelevantDatatype (Closure Type) | data type, but in irrelevant position |
CoinductiveDatatype (Closure Type) | coinductive data type |
CantSplit QName Telescope Args Args [Term] | |
GenericSplitError String |
Instances
data TypeError
Constructors
data TCErr
Type-checking errors.
Constructors
TypeError TCState (Closure TypeError) | |
Exception Range String | |
IOException Range IOException | |
PatternErr TCState | for pattern violations |
The reduce monad
data ReduceEnv
Environment of the reduce monad.
newtype ReduceM a
runReduceM :: ReduceM a -> TCM a
Type checking monad transformer
newtype TCMT m a
Instances
MonadTrans TCMT | |
MonadError TCErr IM | |
MonadError TCErr (TCMT IO) | |
MonadIO m => MonadReader TCEnv (TCMT m) | |
MonadIO m => MonadState TCState (TCMT m) | |
MonadIO m => Monad (TCMT m) | |
MonadIO m => Functor (TCMT m) | |
MonadIO m => Applicative (TCMT m) | |
MonadIO m => MonadIO (TCMT m) | |
MonadIO m => MonadTCM (TCMT m) | |
MonadIO m => HasBuiltins (TCMT m) | |
MonadIO m => HasOptions (TCMT m) | |
HasConstInfo (TCMT IO) |
class (Applicative tcm, MonadIO tcm, MonadReader TCEnv tcm, MonadState TCState tcm) => MonadTCM tcm where
catchError_ :: TCM a -> (TCErr -> TCM a) -> TCM a
Preserve the state of the failing computation.
returnTCMT :: MonadIO m => a -> TCMT m a
patternViolation :: TCM a
internalError :: MonadTCM tcm => String -> tcm a
runTCM :: MonadIO m => TCEnv -> TCState -> TCMT m a -> m (a, TCState)
Running the type checking monad (most general form).
runTCMTop :: TCM a -> IO (Either TCErr a)
Running the type checking monad on toplevel (with initial state).
runTCMTop' :: MonadIO m => TCMT m a -> m a
runSafeTCM :: TCM a -> TCState -> IO (a, TCState)
runSafeTCM
runs a safe TCM
action (a TCM
action which cannot fail)
in the initial environment.
Runs the given computation in a separate thread, with a copy of the current state and environment.
Note that Agda sometimes uses actual, mutable state. If the
computation given to forkTCM
tries to modify this state, then
bad things can happen, because accesses are not mutually exclusive.
The forkTCM
function has been added mainly to allow the thread to
read (a snapshot of) the current state in a convenient way.
Note also that exceptions which are raised in the thread are not propagated to the parent, so the thread should not do anything important.
extendlambdaname :: [Char]
Base name for extended lambda patterns
absurdLambdaName :: [Char]
Name of absurdLambda definitions.
isAbsurdLambdaName :: QName -> Bool
Check whether we have an definition from an absurd lambda.