If the first argument is Erased something, then hard
compile-time mode is enabled when the continuation is run.
ModuleAgda-2.7.0.1Haskell2010
Agda.TypeChecking.Monad.Signature
- 1 type
- 1 class
- 96 values
- PackageAgda-2.7.0.1
- Exports98
- LanguageHaskell2010
- LicenceMIT
- SourceSignature.hs
setHardCompileTimeModeIfErased' :: LensQuantity q=> qThe quantity.
-> TCM aContinuation.
-> TCM a
If the quantity is "erased", then hard compile-time mode is enabled when the continuation is run.
Precondition: The quantity must not be Quantity1 something.
Use run-time mode in the continuation unless the current mode is the hard compile-time mode.
Warn if the user explicitly wrote @ω or @plenty but the
current mode is the hard compile-time mode.
Add a constant to the signature. Lifts the definition to top level.
A combination of addConstant and defaultDefn. The Language does not need to be supplied.
Set termination info of a defined function symbol.
Set CompiledClauses of a defined function symbol.
Set SplitTree of a defined function symbol.
Modify the clauses of a function.
Lifts clauses to the top-level and adds them to definition.
Also adjusts the funCopatternLHS field if necessary.
Add a section to the signature.
The current context will be stored as the cumulative module parameters for this section.
Sets the checkpoint for the given module to the current checkpoint.
Get a section.
Why Maybe? The reason is that we look up all prefixes of a module to compute number of parameters, and for hierarchical top-level modules, A.B.C say, A and A.B do not exist.
Lookup a section telescope.
If it doesn't exist, like in hierarchical top-level modules, the section telescope is empty.
Add display forms for a name f copied by a module application. Essentially if f can reduce to
λ xs → A.B.C.f vs
by unfolding module application copies (defCopy), then we add a display form
A.B.C.f vs ==> f xs
applySection :: ModuleNameName of new module defined by the module macro.
-> TelescopeParameters of new module.
-> ModuleNameName of old module applied to arguments.
-> ArgsArguments of module application.
-> ScopeCopyInfoImported names and modules
-> TCM ()
Module application (followed by module parameter abstraction).
Add a display form to a definition (could be in this or imported signature).
Find all names used (recursively) by display forms of a given name.
Check if a display form is looping.
Does the given constructor come from a single-constructor type?
Precondition: The name has to refer to a constructor.
Signature lookup errors.
Constructors
SigUnknown StringThe name is not in the signature; default error message.
SigAbstractThe name is not available, since it is abstract.
SigCubicalNotErasureThe name is not available because it was defined in Cubical Agda, but the current language is Erased Cubical Agda, and
--erasureis not active.
Generates an error message corresponding to SigCubicalNotErasure for a given QName.
Generates an error message corresponding to SigCubicalNotErasure for a given QName.
An eliminator for SigError. All constructors except for SigAbstract are assumed to be impossible.
class (Functor m, Applicative m, MonadFail m, HasOptions m, MonadDebug m, MonadTCEnv m) => HasConstInfo (m :: Type -> Type) whereMethods
getConstInfo :: QName -> m DefinitionLookup the definition of a name. The result is a closed thing, all free variables have been abstracted over.
getConstInfo' :: QName -> m (Either SigError Definition)Version that reports exceptions:
getRewriteRulesFor :: QName -> m RewriteRulesLookup the rewrite rules with the given head symbol.
Instances17HasConstInfo, …
HasConstInfo AbsToConDefined in Agda-2.7.0.1 · Agda.Syntax.Translation.AbstractToConcreteHasConstInfo TerMDefined in Agda-2.7.0.1 · Agda.Termination.MonadHasConstInfo ForcedVariableCollection'Defined in Agda-2.7.0.1 · Agda.TypeChecking.ForcingHasConstInfo ReduceMDefined in Agda-2.7.0.1 · Agda.TypeChecking.Reduce.Monad · orphanHasConstInfo NLMDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rewriting.NonLinMatchHasConstInfo (TCMT IO)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (PureConversionT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Conversion.PureHasConstInfo m => HasConstInfo (BlockT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (NamesT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.NamesHasConstInfo m => HasConstInfo (ListT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (ChangeT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (MaybeT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (ExceptT err m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (IdentityT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (ReaderT r m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.SignatureHasConstInfo m => HasConstInfo (StateT s m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.Signature(Monoid w, HasConstInfo m) => HasConstInfo (WriterT w m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.Signature
The computation getConstInfo sometimes tweaks the returned Definition, depending on the current Language and the Language of the Definition. This variant of getConstInfo does not perform any tweaks.
Get the original name of the projection (the current one could be from a module application).
Look up the polarity of a definition.
Look up polarity of a definition and compose with polarity represented by Comparison.
Set the polarity of a definition.
Look up the forced arguments of a definition.
Get argument occurrence info for argument i of definition d (never fails).
Sets the defArgOccurrences for the given identifier (which should already exist in the signature).
add data constructors to a datatype
Get the mutually recursive identifiers of a symbol from the signature.
Get the mutually recursive identifiers from a Definition.
Set the mutually recursive identifiers.
TODO: This produces data of quadratic size (which has to be processed upon serialization). Presumably qs is usually short, but in some cases (for instance for generated code) it may be long. It would be better to assign a unique identifier to each SCC, and store the names separately.
Check whether two definitions are mutually recursive.
A functiondatarecord definition is nonRecursive if it is not even mutually recursive with itself.
Get the number of parameters to the current module.
Compute the number of free variables of a defined name. This is the sum of number of parameters shared with the current module and the number of anonymous variables (if the name comes from a let-bound module).
Compute the context variables to apply a definition to.
We have to insert the module telescope of the common prefix of the current module and the module where the definition comes from. (Properly raised to the current context.)
Example:
module M₁ Γ where
module M₁ Δ where
f = ...
module M₃ Θ where
... M₁.M₂.f [insert Γ raised by Θ]
Unless all variables in the context are module parameters, create a fresh module to capture the non-module parameters. Used when unquoting to make sure generated definitions work properly.
Instantiate a closed definition with the correct part of the current context.
Return the abstract view of a definition, regardless of whether the definition would be treated abstractly.
Enter abstract mode. Abstract definition in the current module are transparent.
Not in abstract mode. All abstract definitions are opaque.
Ignore abstract mode. All abstract definitions are transparent.
Go under the given opaque block. The unfolding set will turn opaque definitions transparent.
Outside of any opaque blocks.
Enter the reducibility environment associated with a definition: The environment will have the same concreteness as the name, and we will be in the opaque block enclosing the name, if any.
Get type of a constant, instantiated to the current context.
Get relevance of a constant.
Get modality of a constant.
The number of dropped parameters for a definition. 0 except for projection(-like) functions and constructors.
Is it the name of a record projection?
Is it the name of a non-irrelevant record projection?
Is it a function marked STATIC?
Is it a function marked INLINE?
Returns True if we are dealing with a proper projection,
i.e., not a projection-like function nor a record field value
(projection applied to argument).
Number of dropped initial arguments of a projection(-like) function.
Check whether a definition uses copatterns.
Apply a function f to its first argument, producing the proper
postfix projection if f is a projection which is not irrelevant.