Idris2Doc : Language.Reflection.Types

Language.Reflection.Types

(source)

Definitions

Res : Type->Type
Totality: total
Visibility: public export
freshNames : String-> (n : Nat) ->VectnName
  Creates a sequence of argument names, using the given string as a prefix
and appending names with their index in the sequence.

It is at times necessary to provide a set of fresh names to
for instance pattern matching on a data constructor making sure
to not shadow already existing
names. This function provides a pure way to do so without having
to run this in the `Elab` monad.

Totality: total
Visibility: export
implicits : Foldablet=>tName->ListArg
Totality: total
Visibility: public export
tryAll : Applicativef=> ((v : a) ->f (pv)) -> (vs : Vectna) ->f (Allpvs)
  Tries to generate the given proofs for all values in the
given vector over an applicative functor.

Totality: total
Visibility: public export
dataMissingInfo : PiInfoTTImp->Type
Totality: total
Visibility: public export
Constructors:
Auto : MissingInfoAutoImplicit
Implicit : MissingInfoImplicitArg
Deflt : MissingInfo (DefImplicitt)

Hint: 
Uninhabited (MissingInfoExplicitArg)
dataAppArg : Arg->Type
  An argument extracted from an applied function.

We use these to match result types of data constructors against the
arguments of the corresponding type constructor, so they
are indexed by the corresponding argument.

Totality: total
Visibility: public export
Constructors:
NamedApp : (n : Name) ->TTImp->AppArg (MkArgcp (Justn) t)
  Named application: `foo {x = 12}`
AutoApp : TTImp->AppArg (MkArgcAutoImplicitnt)
  Applying an unnamed auto implicit: `foo @{MyEq}`
Regular : TTImp->AppArg (MkArgcExplicitArgnt)
  Regular function application: `foo 12`.
Missing : MissingInfop->AppArg (MkArgcpnt)
  An implicit argument not given explicitly.
.ttimp : AppArga->TTImp
Totality: total
Visibility: public export
appArg : TTImp->AppArga->TTImp
  Applies an argument to the given value.

Totality: total
Visibility: public export
0AppArgs : VectnArg->Type
  Sequence of applied arguments matching a list of function arguments.

Totality: total
Visibility: public export
getArg : (arg : Arg) ->TTImp->Maybe (AppArgarg, TTImp)
  Tries to extract an applied argument from an expression,
returning it together with the remainder of the expression.

Totality: total
Visibility: export
getArgs : (vs : VectnArg) ->TTImp->Res (AppArgsvs, TTImp)
  Tries to unapply an expression and extract all
applied function arguments.

Totality: total
Visibility: public export
recordCon : (n : Nat) ->VectnArg->Type
  Data constructor of a data type index over the list of arguments
of the corresponding type constructor.

Totality: total
Visibility: public export
Constructor: 
MkCon : Name-> (arty : Nat) ->VectartyArg->AppArgsvs->Connvs

Projections:
.args : ({rec:0} : Connvs) ->Vect (arty{rec:0}) Arg
.arty : Connvs->Nat
.name : Connvs->Name
.typeArgs : Connvs->AppArgsvs

Hint: 
Named (Connvs)
.name : Connvs->Name
Totality: total
Visibility: public export
name : Connvs->Name
Totality: total
Visibility: public export
.arty : Connvs->Nat
Totality: total
Visibility: public export
arty : Connvs->Nat
Totality: total
Visibility: public export
.args : ({rec:0} : Connvs) ->Vect (arty{rec:0}) Arg
Totality: total
Visibility: public export
args : ({rec:0} : Connvs) ->Vect (arty{rec:0}) Arg
Totality: total
Visibility: public export
.typeArgs : Connvs->AppArgsvs
Totality: total
Visibility: public export
typeArgs : Connvs->AppArgsvs
Totality: total
Visibility: public export
isConstant : Connvs->Bool
  True if the given constructor has only erased arguments.

Totality: total
Visibility: public export
bindCon : (c : Connvs) ->Vect (c.arty) Name->TTImp
  Creates bindings for the explicit arguments of a data constructor
using the given prefix plus an index for the name of each
argument.

This is useful for implementing functions which pattern match on a
data constructor.

Totality: total
Visibility: export
applyCon : (c : Connvs) ->Vect (c.arty) Name->TTImp
  Applies a constructor to variables of the given name.

Totality: total
Visibility: export
getCon : Elaborationm=> (vs : VectnArg) ->Name->m (Connvs)
  Tries to lookup a data constructor by name, based on the
given list of arguments of the corresponding data constructor.

Totality: total
Visibility: export
recordTypeInfo : Type
  Information about a data type

@name : Name of the data type
Note: There is no guarantee that the name will be fully
qualified
@args : Type arguments of the data type
@cons : List of data constructors

Totality: total
Visibility: public export
Constructor: 
MkTypeInfo : Name-> (arty : Nat) -> (args : VectartyArg) ->VectartyName->List (Conartyargs) ->TypeInfo

Projections:
.argNames : ({rec:0} : TypeInfo) ->Vect (arty{rec:0}) Name
.args : ({rec:0} : TypeInfo) ->Vect (arty{rec:0}) Arg
.arty : TypeInfo->Nat
.cons : ({rec:0} : TypeInfo) ->List (Con (arty{rec:0}) (args{rec:0}))
.name : TypeInfo->Name

Hints:
ElaborateableTypeInfo
NamedTypeInfo
.name : TypeInfo->Name
Totality: total
Visibility: public export
name : TypeInfo->Name
Totality: total
Visibility: public export
.arty : TypeInfo->Nat
Totality: total
Visibility: public export
arty : TypeInfo->Nat
Totality: total
Visibility: public export
.args : ({rec:0} : TypeInfo) ->Vect (arty{rec:0}) Arg
Totality: total
Visibility: public export
args : ({rec:0} : TypeInfo) ->Vect (arty{rec:0}) Arg
Totality: total
Visibility: public export
.argNames : ({rec:0} : TypeInfo) ->Vect (arty{rec:0}) Name
Totality: total
Visibility: public export
argNames : ({rec:0} : TypeInfo) ->Vect (arty{rec:0}) Name
Totality: total
Visibility: public export
.cons : ({rec:0} : TypeInfo) ->List (Con (arty{rec:0}) (args{rec:0}))
Totality: total
Visibility: public export
cons : ({rec:0} : TypeInfo) ->List (Con (arty{rec:0}) (args{rec:0}))
Totality: total
Visibility: public export
namedArg : Arg->MaybeName
Totality: total
Visibility: public export
.explicitArgs : TypeInfo->ListName
  Returns the names of explicit arguments of a type constructor.

Totality: total
Visibility: public export
.applied : TypeInfo->TTImp
  Returns a type constructor
applied to the names of its explicit arguments

Totality: total
Visibility: public export
.implicits : TypeInfo->ListArg
  Returns a list of implicit arguments corresponding
to the data type's implicit and explicit arguments.

Totality: total
Visibility: public export
isEnum : TypeInfo->Bool
  True if the given type has only constant constructors and
is therefore represented by a single unsigned integer at runtime.

Totality: total
Visibility: public export
isNil : Connvs->Bool
  True if the given constructor has name `Nil` and no explicit arguments.

Totality: total
Visibility: public export
isCons : Connvs->Bool
  True if the given constructor has name `(::)` and
exactly two explicit arguments.

Totality: total
Visibility: public export
isLin : Connvs->Bool
  True if the given constructor has name `Lin` and no explicit arguments.

Totality: total
Visibility: public export
isSnoc : Connvs->Bool
  True if the given constructor has name `(:<)` and
exactly two explicit arguments.

Totality: total
Visibility: public export
isNewtype : TypeInfo->Bool
  True if the given type has a single constructor with a single
unerased argument.

Totality: total
Visibility: public export
isListLike : TypeInfo->Bool
  True, if the given type has exactly one
`Nil` constructor with no explicit
argument and a `(::)` constructor with two explicit arguments.

Totality: total
Visibility: public export
isSnocListLike : TypeInfo->Bool
  True, if the given type has exactly one
`Lin` constructor with no explicit
argument and a `(:<)` constructor with two explicit arguments.

Totality: total
Visibility: public export
isErased : TypeInfo->Bool
  True if the given type has a single constructor with only erased
arguments. Such a value will have a trivial runtime representation.

Totality: total
Visibility: public export
getInfo' : Elaborationm=>Name->mTypeInfo
  Tries to get information about the data type specified
by name. The name need not be fully qualified, but
needs to be unambiguous.

Totality: total
Visibility: export
getInfo : Name->ElabTypeInfo
  macro version of `getInfo'`

Totality: total
Visibility: export
singleCon : Name->ElabName
  Tries to get the name of the sole constructor
of data type specified by name. Fails, if
the name is not unambiguous, or if the data type
in question has not exactly one constructor.

Totality: total
Visibility: export
dataParamTag : Nat->Type
Totality: total
Visibility: public export
Constructors:
I : ParamTag0
P : ParamTag1
dataParamPattern : Nat->Nat->Type
Totality: total
Visibility: public export
Constructors:
Nil : ParamPattern00
(::) : ParamTagk->ParamPatternmn->ParamPattern (Sm) (k+n)
paramsOnly : (k : Nat) ->ParamPatternkk
Totality: total
Visibility: public export
indicesOnly : (k : Nat) ->ParamPatternk0
Totality: total
Visibility: public export
extractParams : ParamPatternnk->Vectna->Vectka
Totality: total
Visibility: public export
dataPArg : Nat->Type
  Constructor argument type in a parameterized data type
with `n` parameters.

Totality: total
Visibility: public export
Constructors:
PPar : Finn->PArgn
PVar : Name->PArgn
PLam : Count->PiInfoTTImp->MaybeName->PArgn->PArgn->PArgn
PApp : PArgn->PArgn->PArgn
PNamedApp : PArgn->Name->PArgn->PArgn
PAutoApp : PArgn->PArgn->PArgn
PWithApp : PArgn->PArgn->PArgn
PSearch : Nat->PArgn
PPrim : Constant->PArgn
PDelayed : LazyReason->PArgn->PArgn
PType : PArgn
PHole : String->PArgn

Hint: 
Eq (PArgn)
pvar : Nameda=>Vectna->ListName->Name->PArgn
  Checks if the given name corresponds to a parameter, in
which case it must be present in the given vector of names.

Totality: total
Visibility: public export
parg : Nameda=>Vectna->ListName->TTImp->Res (PArgn)
  Tries to convert a `TTImp` to an argument of a
parameterized constructor using the given vector of parameter names.

Totality: total
Visibility: public export
ttimp : VectnName->PArgn->TTImp
  Converts an argument of a parameterized data type to the
corresponding `TTImp` expression.

Totality: total
Visibility: public export
paramArgs : PArgn->List (PArgn)
  Extracts the sub-expressions from an argument's type
where the outermost value is a parameter.

Example:
If `f`, `a`, and `b` are parameters, this will extract
`[f Int, f a, b]` from `Maybe (Pair (f Int, Pair (f a, b)))`

Totality: total
Visibility: public export
paramNames : ParamPatternnk->AppArgsvs->Res (VectkName)
Totality: total
Visibility: public export
dataConArg : Nat->Type
  Argument of a data constructor of a parameterized data type.

Totality: total
Visibility: public export
Constructors:
ParamArg : Finn->TTImp->ConArgn
CArg : MaybeName->Count->PiInfoTTImp->PArgn->ConArgn
isExplicit : ConArgn->Bool
Totality: total
Visibility: public export
conArg : VectnName->Arg->Res (ConArgn)
Totality: total
Visibility: public export
paramArgs : ConArgn->List (PArgn)
Totality: total
Visibility: public export
recordParamCon : Nat->Type
Totality: total
Visibility: public export
Constructor: 
MkParamCon : Name-> (arty : Nat) ->Vectarty (ConArgn) ->ParamConn

Projections:
.args : ({rec:0} : ParamConn) ->Vect (arty{rec:0}) (ConArgn)
.arty : ParamConn->Nat
.name : ParamConn->Name

Hint: 
Named (ParamConn)
.name : ParamConn->Name
Totality: total
Visibility: public export
name : ParamConn->Name
Totality: total
Visibility: public export
.arty : ParamConn->Nat
Totality: total
Visibility: public export
arty : ParamConn->Nat
Totality: total
Visibility: public export
.args : ({rec:0} : ParamConn) ->Vect (arty{rec:0}) (ConArgn)
Totality: total
Visibility: public export
args : ({rec:0} : ParamConn) ->Vect (arty{rec:0}) (ConArgn)
Totality: total
Visibility: public export
paramArgs : ParamConn->List (PArgn)
Totality: total
Visibility: public export
paramCon : ParamPatternnk->Connvs->Res (ParamConk)
Totality: total
Visibility: public export
recordParamTypeInfo : Type
Totality: total
Visibility: public export
Constructor: 
MkParamTypeInfo : (info : TypeInfo) ->ParamPattern (info.arty) numParams->VectnumParamsName->List (ParamConnumParams) ->List (PArgnumParams) ->ParamTypeInfo

Projections:
.applied : ParamTypeInfo->TTImp
  Returns the type constructor of a parameterized
data type applied to its parameters
.cons : ({rec:0} : ParamTypeInfo) ->List (ParamCon (numParams{rec:0}))
  List of data constructors
.implicits : ParamTypeInfo->ListArg
  Returns a list of implicit arguments corresponding
to the data type's arguments.
.info : ParamTypeInfo->TypeInfo
  Underlying type info
0.numParams : ParamTypeInfo->Nat
.paramNames : ({rec:0} : ParamTypeInfo) ->Vect (numParams{rec:0}) Name
  Name of parameters
.pargs : ({rec:0} : ParamTypeInfo) ->List (PArg (numParams{rec:0}))
  List of types appearing in constructor arguments, where the
the outermost applied type is one of the parameters. We use this
to generate the constraints necessary to implement interfaces such
as `Eq` or `Ord`.

For instance, in case of a constructor argument `Either (f a) (b, f Nat)`
with `f`, `a`, and `b` being parameters, this list will contain
the encoded forms of `f a`, `f Nat`, and `b`.
.pattern : ({rec:0} : ParamTypeInfo) ->ParamPattern ((info{rec:0}) .arty) (numParams{rec:0})
  Information about which type arguments are parameters and
which are indices

Hint: 
NamedParamTypeInfo
.info : ParamTypeInfo->TypeInfo
  Underlying type info

Totality: total
Visibility: public export
info : ParamTypeInfo->TypeInfo
  Underlying type info

Totality: total
Visibility: public export
.pattern : ({rec:0} : ParamTypeInfo) ->ParamPattern ((info{rec:0}) .arty) (numParams{rec:0})
  Information about which type arguments are parameters and
which are indices

Totality: total
Visibility: public export
pattern : ({rec:0} : ParamTypeInfo) ->ParamPattern ((info{rec:0}) .arty) (numParams{rec:0})
  Information about which type arguments are parameters and
which are indices

Totality: total
Visibility: public export
.paramNames : ({rec:0} : ParamTypeInfo) ->Vect (numParams{rec:0}) Name
  Name of parameters

Totality: total
Visibility: public export
paramNames : ({rec:0} : ParamTypeInfo) ->Vect (numParams{rec:0}) Name
  Name of parameters

Totality: total
Visibility: public export
.cons : ({rec:0} : ParamTypeInfo) ->List (ParamCon (numParams{rec:0}))
  List of data constructors

Totality: total
Visibility: public export
cons : ({rec:0} : ParamTypeInfo) ->List (ParamCon (numParams{rec:0}))
  List of data constructors

Totality: total
Visibility: public export
.pargs : ({rec:0} : ParamTypeInfo) ->List (PArg (numParams{rec:0}))
  List of types appearing in constructor arguments, where the
the outermost applied type is one of the parameters. We use this
to generate the constraints necessary to implement interfaces such
as `Eq` or `Ord`.

For instance, in case of a constructor argument `Either (f a) (b, f Nat)`
with `f`, `a`, and `b` being parameters, this list will contain
the encoded forms of `f a`, `f Nat`, and `b`.

Totality: total
Visibility: public export
pargs : ({rec:0} : ParamTypeInfo) ->List (PArg (numParams{rec:0}))
  List of types appearing in constructor arguments, where the
the outermost applied type is one of the parameters. We use this
to generate the constraints necessary to implement interfaces such
as `Eq` or `Ord`.

For instance, in case of a constructor argument `Either (f a) (b, f Nat)`
with `f`, `a`, and `b` being parameters, this list will contain
the encoded forms of `f a`, `f Nat`, and `b`.

Totality: total
Visibility: public export
paramType : (ti : TypeInfo) ->ParamPattern (ti.arty) k->ResParamTypeInfo
Totality: total
Visibility: public export
constraints : ParamTypeInfo->Name->ListArg
  Returns the constraints required to implement the given interface
for the given parameterized data types.

The interface must be of type `Type -> Type`.

Totality: total
Visibility: export
.applied : ParamTypeInfo->TTImp
  Returns the type constructor of a parameterized
data type applied to its parameters

Totality: total
Visibility: public export
.implicits : ParamTypeInfo->ListArg
  Returns a list of implicit arguments corresponding
to the data type's arguments.

Totality: total
Visibility: public export
allImplicits : ParamTypeInfo->Name->ListArg
  Short-hand for `p.implicits ++ constraints iname p`.

Totality: total
Visibility: public export
getParamInfo' : Elaborationm=>Name->mParamTypeInfo
  Returns information about a parameterized data type
specified by the given (probably not fully qualified) name
and a strategy for distinguishing between type parameters
and indices.

Totality: total
Visibility: export
getParamInfo : Name->ElabParamTypeInfo
  macro version of `getParamInfo`.

Totality: total
Visibility: export