Idris2Doc : Language.Reflection

Language.Reflection

Reexports

importpublic Language.Reflection.TT
importpublic Language.Reflection.TTImp
importpublic Control.Monad.Trans

Definitions

dataLookupDir : Type
Totality: total
Visibility: public export
Constructors:
ProjectDir : LookupDir
  The dir of the `ipkg`-file, or the current dir if there is no one
SourceDir : LookupDir
  The source dir set in the `ipkg`-file, or the current dir if there is no one
CurrentModuleDir : LookupDir
  The dir where the current module is located

For the module `Language.Reflection` it would be `<source_dir>/Language/`
SubmodulesDir : LookupDir
  The dir where submodules of the current module are located

For the module `Language.Reflection` it would be `<source_dir>/Language/Reflection/`
BuildDir : LookupDir
  The dir where built files are located, set in the `ipkg`-file and defaulted to `build`
dataElab : Type->Type
  Elaboration scripts
Where types/terms are returned, binders will have unique, if not
necessarily human readabe, names

Totality: total
Visibility: export
Constructors:
Pure : a->Elaba
Bind : Elaba-> (a->Elabb) ->Elabb
Fail : FC->String->Elaba
Warn : FC->String->Elab ()
Try : Elaba->Elaba->Elaba
LogMsg : String->Nat->String->Elab ()
  Log a message. Takes a
* topic
* level
* message
LogTerm : String->Nat->String->TTImp->Elab ()
  Print and log a term. Takes a
* topic
* level
* message
* term
LogSugaredTerm : String->Nat->String->TTImp->Elab ()
  Resugar, print and log a term. Takes a
* topic
* level
* message
* term
Check : TTImp->Elabexpected
Quote : (0_ : val) ->ElabTTImp
Lambda : (0x : Type) -> {0ty : x->Type} -> ((val : x) ->Elab (tyval)) ->Elab ((val : x) ->tyval)
Goal : Elab (MaybeTTImp)
LocalVars : Elab (ListName)
GenSym : String->ElabName
InCurrentNS : Name->ElabName
GetType : Name->Elab (List (Name, TTImp))
GetInfo : Name->Elab (List (Name, NameInfo))
GetLocalType : Name->ElabTTImp
GetCons : Name->Elab (ListName)
GetReferredFns : Name->Elab (ListName)
GetCurrentFn : Elab (SnocListName)
Declare : ListDecl->Elab ()
ReadFile : LookupDir->String->Elab (MaybeString)
WriteFile : LookupDir->String->String->Elab ()
IdrisDir : LookupDir->ElabString

Hints:
AlternativeElab
ApplicativeElab
ElaborationElab
FunctorElab
MonadElab
interfaceElaboration : (Type->Type) ->Type
Parameters: m
Constraints: Monad m
Methods:
failAt : FC->String->ma
  Report an error in elaboration at some location
warnAt : FC->String->m ()
  Report a warning in elaboration at some location
try : Elaba->Elaba->ma
  Try the first elaborator. If it fails, reset the elaborator state and
run the second
logMsg : String->Nat->String->m ()
  Write a log message, if the log level is >= the given level
logTerm : String->Nat->String->TTImp->m ()
  Write a log message and a rendered term, if the log level is >= the given level
logSugaredTerm : String->Nat->String->TTImp->m ()
  Write a log message and a resugared & rendered term, if the log level is >= the given level
check : TTImp->mexpected
  Check that some TTImp syntax has the expected type
Returns the type checked value
quote : (0_ : val) ->mTTImp
  Return TTImp syntax of a given value
lambda : (0x : Type) -> {0ty : x->Type} -> ((val : x) ->Elab (tyval)) ->m ((val : x) ->tyval)
  Build a lambda expression
goal : m (MaybeTTImp)
  Get the goal type of the current elaboration

`Nothing` means the script is run in the top-level `%runElab` clause.
If elaboration script is run in expression mode, this function will always return `Just`.
In the case of unknown result type in the expression mode, returned `TTImp` would be an `IHole`.
localVars : m (ListName)
  Get the names of the local variables in scope
genSym : String->mName
  Generate a new unique name
inCurrentNS : Name->mName
  Given a name, return the name decorated with the current namespace
getType : Name->m (List (Name, TTImp))
  Given a possibly ambiguous name, get all the matching names and their types
getInfo : Name->m (List (Name, NameInfo))
  Get the metadata associated with a name. Returns all matching names and their types
getLocalType : Name->mTTImp
  Get the type of a local variable
getCons : Name->m (ListName)
  Get the constructors of a fully qualified data type name
getReferredFns : Name->m (ListName)
  Get all the name of function definitions that a given definition refers to (transitively)
getCurrentFn : m (SnocListName)
  Get the name of the current and outer functions, if we are in a function
declare : ListDecl->m ()
  Make some top level declarations
readFile : LookupDir->String->m (MaybeString)
  Read the contents of a file, if it is present
writeFile : LookupDir->String->String->m ()
  Writes to a file, replacing existing contents, if were present
idrisDir : LookupDir->mString
  Returns the specified type of dir related to the current idris project

Implementations:
ElaborationElab
Elaborationm=>MonadTranst=>Monad (tm) =>Elaboration (tm)
failAt : Elaborationm=>FC->String->ma
  Report an error in elaboration at some location

Totality: total
Visibility: public export
warnAt : Elaborationm=>FC->String->m ()
  Report a warning in elaboration at some location

Totality: total
Visibility: public export
try : Elaborationm=>Elaba->Elaba->ma
  Try the first elaborator. If it fails, reset the elaborator state and
run the second

Totality: total
Visibility: public export
logMsg : Elaborationm=>String->Nat->String->m ()
  Write a log message, if the log level is >= the given level

Totality: total
Visibility: public export
logTerm : Elaborationm=>String->Nat->String->TTImp->m ()
  Write a log message and a rendered term, if the log level is >= the given level

Totality: total
Visibility: public export
logSugaredTerm : Elaborationm=>String->Nat->String->TTImp->m ()
  Write a log message and a resugared & rendered term, if the log level is >= the given level

Totality: total
Visibility: public export
check : Elaborationm=>TTImp->mexpected
  Check that some TTImp syntax has the expected type
Returns the type checked value

Totality: total
Visibility: public export
quote : Elaborationm=> (0_ : val) ->mTTImp
  Return TTImp syntax of a given value

Totality: total
Visibility: public export
lambda : Elaborationm=> (0x : Type) -> {0ty : x->Type} -> ((val : x) ->Elab (tyval)) ->m ((val : x) ->tyval)
  Build a lambda expression

Totality: total
Visibility: public export
goal : Elaborationm=>m (MaybeTTImp)
  Get the goal type of the current elaboration

`Nothing` means the script is run in the top-level `%runElab` clause.
If elaboration script is run in expression mode, this function will always return `Just`.
In the case of unknown result type in the expression mode, returned `TTImp` would be an `IHole`.

Totality: total
Visibility: public export
localVars : Elaborationm=>m (ListName)
  Get the names of the local variables in scope

Totality: total
Visibility: public export
genSym : Elaborationm=>String->mName
  Generate a new unique name

Totality: total
Visibility: public export
inCurrentNS : Elaborationm=>Name->mName
  Given a name, return the name decorated with the current namespace

Totality: total
Visibility: public export
getType : Elaborationm=>Name->m (List (Name, TTImp))
  Given a possibly ambiguous name, get all the matching names and their types

Totality: total
Visibility: public export
getInfo : Elaborationm=>Name->m (List (Name, NameInfo))
  Get the metadata associated with a name. Returns all matching names and their types

Totality: total
Visibility: public export
getLocalType : Elaborationm=>Name->mTTImp
  Get the type of a local variable

Totality: total
Visibility: public export
getCons : Elaborationm=>Name->m (ListName)
  Get the constructors of a fully qualified data type name

Totality: total
Visibility: public export
getReferredFns : Elaborationm=>Name->m (ListName)
  Get all the name of function definitions that a given definition refers to (transitively)

Totality: total
Visibility: public export
getCurrentFn : Elaborationm=>m (SnocListName)
  Get the name of the current and outer functions, if we are in a function

Totality: total
Visibility: public export
declare : Elaborationm=>ListDecl->m ()
  Make some top level declarations

Totality: total
Visibility: public export
readFile : Elaborationm=>LookupDir->String->m (MaybeString)
  Read the contents of a file, if it is present

Totality: total
Visibility: public export
writeFile : Elaborationm=>LookupDir->String->String->m ()
  Writes to a file, replacing existing contents, if were present

Totality: total
Visibility: public export
idrisDir : Elaborationm=>LookupDir->mString
  Returns the specified type of dir related to the current idris project

Totality: total
Visibility: public export
fail : Elaborationm=>String->ma
  Report an error in elaboration

Totality: total
Visibility: export
warn : Elaborationm=>String->m ()
  Report an error in elaboration

Totality: total
Visibility: export
logGoal : Elaborationm=>String->Nat->String->m ()
  Log the current goal type, if the log level is >= the given level

Totality: total
Visibility: export
catch : Elaborationm=>Elaba->m (Maybea)
  Catch failures and use the `Maybe` monad instead

Totality: total
Visibility: export
search : Elaborationm=> (ty : Type) ->m (Maybety)
  Run proof search to attempt to find a value of the input type.
Useful to check whether a give interface constraint is satisfied.

Totality: total
Visibility: export