Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions for inserting implicit arguments at the right places.
Synopsis
- implicitArgs :: Int -> (Hiding -> Bool) -> Type -> TCM (Args, Type)
- implicitNamedArgs :: Int -> (Hiding -> ArgName -> Bool) -> Type -> TCM (NamedArgs, Type)
- newMetaArg :: ArgInfo -> ArgName -> Type -> TCM (MetaId, Term)
- newInteractionMetaArg :: ArgInfo -> ArgName -> Type -> TCM (MetaId, Term)
- data ImplicitInsertion
- pattern NoInsertNeeded :: ImplicitInsertion
- insertImplicit :: NamedArg e -> [Dom a] -> ImplicitInsertion
- insertImplicit' :: NamedArg e -> [Arg ArgName] -> ImplicitInsertion
Documentation
:: Int |
|
-> (Hiding -> Bool) |
|
-> Type | The (function) type |
-> TCM (Args, Type) | The eliminating arguments and the remaining type. |
implicitArgs n expand t
generates up to n
implicit arguments
metas (unbounded if n<0
), as long as t
is a function type
and expand
holds on the hiding info of its domain.
:: Int |
|
-> (Hiding -> ArgName -> Bool) |
|
-> Type | The (function) type |
-> TCM (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.
:: ArgInfo | Kind/relevance of meta. |
-> ArgName | Name suggestion for meta. |
-> Type | Type of meta. |
-> TCM (MetaId, Term) | The created meta as id and as term. |
Create a metavariable according to the Hiding
info.
newInteractionMetaArg Source #
:: ArgInfo | Kind/relevance of meta. |
-> ArgName | Name suggestion for meta. |
-> Type | Type of meta. |
-> TCM (MetaId, Term) | The created meta as id and as term. |
Create a questionmark according to the Hiding
info.
data ImplicitInsertion Source #
Possible results of insertImplicit
.
ImpInsert [Hiding] | Success: this many implicits have to be inserted (list can be empty). |
BadImplicits | Error: hidden argument where there should have been a non-hidden argument. |
NoSuchName ArgName | Error: bad named argument. |
Instances
Show ImplicitInsertion Source # | |
Defined in Agda.TypeChecking.Implicit showsPrec :: Int -> ImplicitInsertion -> ShowS # show :: ImplicitInsertion -> String # showList :: [ImplicitInsertion] -> ShowS # |
pattern NoInsertNeeded :: ImplicitInsertion Source #
:: NamedArg e | Next given argument |
-> [Dom a] | Expected arguments |
-> 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.
:: NamedArg e | Next given argument |
-> [Arg ArgName] | Expected arguments |
-> 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.