Split a given Pi Type until you reach the given named argument, returning the number of arguments skipped to reach the right plicity and name.
ModuleAgda-2.8.0.2Haskell2010
Agda.TypeChecking.Implicit
Functions for inserting implicit arguments at the right places.
- 1 type
- 7 values
- PackageAgda-2.8.0.2
- Exports9
- LanguageHaskell2010
- LicenceMIT
- SourceImplicit.hs
implicitArgs implicitArgs n expand t generates up to n implicit argument
metas (unbounded if n<0), as long as t is a function type
and expand holds on the hiding info of its domain.
implicitNamedArgs :: (PureTCM m, MonadMetaSolver m, MonadTCM m)=> Intn, the maximum number of implicts to be inserted.-> (Hiding -> ArgName -> Bool)expand, the predicate to test whether we should keep inserting.-> TypeThe (function) type
twe are eliminating.-> m (NamedArgs, Type)The eliminating arguments and the remaining type.
implicitNamedArgs n expand t generates up to n named implicit arguments
metas (unbounded if n<0), as long as t is a function type
and expand holds on the hiding and name info of its domain.
newMetaArg :: (PureTCM m, MonadMetaSolver m)=> MetaKindKind of meta.
-> ArgInfoRrelevance of meta.
-> ArgNameName suggestion for meta.
-> ComparisonCheck (
CmpLeq) or infer (CmpEq) the type.-> TypeType of meta.
-> m (MetaId, Term)The created meta as id and as term.
Create a metavariable of MetaKind.
Create a questionmark (always UnificationMeta).
Possible results of insertImplicit.
Constructors
ImpInsert [Dom ()]Success: this many implicits have to be inserted (list can be empty).
BadImplicitsError: hidden argument where there should have been a non-hidden argument.
NoSuchName ArgNameError: bad named argument.
Instances1Show
Show ImplicitInsertionDefined in Agda-2.8.0.2 · Agda.TypeChecking.Implicit
insertImplicit :: NamedArg eNext given argument
a.-> [Dom a]Expected arguments
ts.-> ImplicitInsertion
If the next given argument is a and the expected arguments are ts
insertImplicit' a ts returns the prefix of ts that precedes a.
If a is named but this name does not appear in ts, the NoSuchName exception is thrown.
insertImplicit' :: NamedArg eNext given argument
a.-> [Dom ArgName]Expected arguments
ts.-> ImplicitInsertion
If the next given argument is a and the expected arguments are ts
insertImplicit' a ts returns the prefix of ts that precedes a.
If a is named but this name does not appear in ts, the NoSuchName exception is thrown.