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

Safe Haskell | None
Language | Haskell2010

Agda.TypeChecking.Rules.Decl

Contents

- Debugging

Synopsis

- checkDeclCached :: Declaration -> TCM ()
- checkDecls :: [Declaration] -> TCM ()
- checkDecl :: Declaration -> TCM ()
- mutualChecks :: MutualInfo -> Declaration -> [Declaration] -> MutualId -> Set QName -> TCM ()
- revisitRecordPatternTranslation :: [QName] -> TCM ()
- type FinalChecks = Maybe (TCM ())
- checkUnquoteDecl :: MutualInfo -> [DefInfo] -> [QName] -> Expr -> TCM FinalChecks
- checkUnquoteDef :: [DefInfo] -> [QName] -> Expr -> TCM ()
- unquoteTop :: [QName] -> Expr -> TCM [QName]
- instantiateDefinitionType :: QName -> TCM ()
- highlight_ :: Declaration -> TCM ()
- checkTermination_ :: Declaration -> TCM ()
- checkPositivity_ :: MutualInfo -> Set QName -> TCM ()
- checkCoinductiveRecords :: [Declaration] -> TCM ()
- checkInjectivity_ :: Set QName -> TCM ()
- checkProjectionLikeness_ :: Set QName -> TCM ()
- whenAbstractFreezeMetasAfter :: DefInfo -> TCM a -> TCM a
- checkAxiom :: Axiom -> DefInfo -> ArgInfo -> Maybe [Occurrence] -> QName -> Expr -> TCM ()
- checkPrimitive :: DefInfo -> QName -> Expr -> TCM ()
- assertCurrentModule :: QName -> String -> TCM ()
- checkPragma :: Range -> Pragma -> TCM ()
- checkMutual :: MutualInfo -> [Declaration] -> TCM (MutualId, Set QName)
- checkTypeSignature :: TypeSignature -> TCM ()
- checkSection :: ModuleInfo -> ModuleName -> Telescope -> [Declaration] -> TCM ()
- checkModuleArity :: ModuleName -> Telescope -> [NamedArg Expr] -> TCM Telescope
- checkSectionApplication :: ModuleInfo -> ModuleName -> ModuleApplication -> ScopeCopyInfo -> TCM ()
- checkSectionApplication' :: ModuleInfo -> ModuleName -> ModuleApplication -> ScopeCopyInfo -> TCM ()
- checkImport :: ModuleInfo -> ModuleName -> TCM ()
- class ShowHead a where
- debugPrintDecl :: Declaration -> TCM ()

# Documentation

checkDeclCached :: Declaration -> TCM () #

Cached checkDecl

checkDecls :: [Declaration] -> TCM () #

Type check a sequence of declarations.

checkDecl :: Declaration -> TCM () #

Type check a single declaration.

mutualChecks :: MutualInfo -> Declaration -> [Declaration] -> MutualId -> Set QName -> TCM () #

revisitRecordPatternTranslation :: [QName] -> TCM () #

Check if there is a inferred eta record type in the mutual block. If yes, repeat the record pattern translation for all function definitions in the block. This is necessary since the original record pattern translation will have skipped record patterns of the new record types (as eta was off for them). See issue 2197).

type FinalChecks = Maybe (TCM ()) #

checkUnquoteDecl :: MutualInfo -> [DefInfo] -> [QName] -> Expr -> TCM FinalChecks #

checkUnquoteDef :: [DefInfo] -> [QName] -> Expr -> TCM () #

unquoteTop :: [QName] -> Expr -> TCM [QName] #

Run a reflected TCM computatation expected to define a given list of names.

instantiateDefinitionType :: QName -> TCM () #

Instantiate all metas in `Definition` associated to `QName`. Makes sense after freezing metas. Some checks, like free variable analysis, are not in `TCM`, so they will be more precise (see issue 1099) after meta instantiation. Precondition: name has been added to signature already.

highlight_ :: Declaration -> TCM () #

Highlight a declaration.

checkTermination_ :: Declaration -> TCM () #

Termination check a declaration.

checkPositivity_ :: MutualInfo -> Set QName -> TCM () #

Check a set of mutual names for positivity.

checkCoinductiveRecords :: [Declaration] -> TCM () #

Check that all coinductive records are actually recursive. (Otherwise, one can implement invalid recursion schemes just like for the old coinduction.)

checkInjectivity_ :: Set QName -> TCM () #

Check a set of mutual names for constructor-headedness.

checkProjectionLikeness_ :: Set QName -> TCM () #

Check a set of mutual names for projection likeness.

Only a single, non-abstract function can be projection-like. Making an abstract function projection-like would break the invariant that the type of the principle argument of a projection-like function is always inferable.

whenAbstractFreezeMetasAfter :: DefInfo -> TCM a -> TCM a #

Freeze metas created by given computation if in abstract mode.

checkAxiom :: Axiom -> DefInfo -> ArgInfo -> Maybe [Occurrence] -> QName -> Expr -> TCM () #

Type check an axiom.

checkPrimitive :: DefInfo -> QName -> Expr -> TCM () #

Type check a primitive function declaration.

assertCurrentModule :: QName -> String -> TCM () #

checkPragma :: Range -> Pragma -> TCM () #

Check a pragma.

checkMutual :: MutualInfo -> [Declaration] -> TCM (MutualId, Set QName) #

Type check a bunch of mutual inductive recursive definitions.

All definitions which have so far been assigned to the given mutual block are returned.

checkTypeSignature :: TypeSignature -> TCM () #

Type check the type signature of an inductive or recursive definition.

checkSection :: ModuleInfo -> ModuleName -> Telescope -> [Declaration] -> TCM () #

Type check a module.

checkModuleArity #

Arguments

:: ModuleName | Name of applied module.
-> Telescope | The module parameters.
-> [NamedArg Expr] | The arguments this module is applied to.
-> TCM Telescope | The remaining module parameters (has free de Bruijn indices!).

Helper for `checkSectionApplication`.

Matches the arguments of the module application with the module parameters.

Returns the remaining module parameters as an open telescope. Warning: the returned telescope is not the final result, an actual instantiation of the parameters does not occur.

checkSectionApplication #

Arguments

:: ModuleInfo |
-> ModuleName | Name `m1` of module defined by the module macro.
-> ModuleApplication | The module macro `λ tel → m2 args`.
-> ScopeCopyInfo | Imported names and modules
-> TCM () |

Check an application of a section (top-level function, includes ``traceCall``).

checkSectionApplication' #

Arguments

:: ModuleInfo |
-> ModuleName | Name `m1` of module defined by the module macro.
-> ModuleApplication | The module macro `λ tel → m2 args`.
-> ScopeCopyInfo | Imported names and modules
-> TCM () |

Check an application of a section.

checkImport :: ModuleInfo -> ModuleName -> TCM () #

Type check an import declaration. Actually doesn't do anything, since all the work is done when scope checking.

# Debugging

class ShowHead a where #

Minimal complete definition

showHead

Methods

showHead :: a -> String #

Instances

ShowHead Declaration # |
Methods showHead :: Declaration -> String #

debugPrintDecl :: Declaration -> TCM () #