idris-1.2.0: Functional Programming Language with Dependent Types

LicenseBSD3
MaintainerThe Idris Community.
Safe HaskellNone
LanguageHaskell2010

Idris.Core.Elaborate

Description

This is our interface to proof construction, rather than ProofState, because this gives us a language to build derived tactics out of the primitives.

Synopsis

Documentation

data ElabState aux Source #

Constructors

ES (ProofState, aux) String (Maybe (ElabState aux)) 

Instances

Show aux => Show (ElabState aux) Source # 

Methods

showsPrec :: Int -> ElabState aux -> ShowS #

show :: ElabState aux -> String #

showList :: [ElabState aux] -> ShowS #

type Elab' aux a = StateT (ElabState aux) TC a Source #

type Elab a = Elab' () a Source #

proofFail :: Elab' aux a -> Elab' aux a Source #

explicit :: Name -> Elab' aux () Source #

addPSname :: Name -> Elab' aux () Source #

transformErr :: (Err -> Err) -> Elab' aux a -> Elab' aux a Source #

Transform the error returned by an elaboration script, preserving location information and proof search failure messages.

errAt :: String -> Name -> Maybe Type -> Elab' aux a -> Elab' aux a Source #

erunAux :: FC -> Elab' aux a -> Elab' aux (a, aux) Source #

erun :: FC -> Elab' aux a -> Elab' aux a Source #

runElab :: aux -> Elab' aux a -> ProofState -> TC (a, ElabState aux) Source #

execElab :: aux -> Elab' aux a -> ProofState -> TC (ElabState aux) Source #

initElaborator Source #

Arguments

:: Name

the name of what's to be elaborated

-> String

the current source file

-> Context

the current global context

-> Ctxt TypeInfo

the value of the idris_datatypes field of IState

-> Int

the value of the idris_name field of IState

-> Type

the goal type

-> ProofState 

elaborate :: String -> Context -> Ctxt TypeInfo -> Int -> Name -> Type -> aux -> Elab' aux a -> TC (a, String) Source #

updateAux :: (aux -> aux) -> Elab' aux () Source #

Modify the auxiliary state

getAux :: Elab' aux aux Source #

Get the auxiliary state

unifyLog :: Bool -> Elab' aux () Source #

Set whether to show the unifier log

processTactic' :: Tactic -> Elab' aux () Source #

Process a tactic within the current elaborator state

now_elaborating :: FC -> Name -> Name -> Elab' aux () Source #

get_context :: Elab' aux Context Source #

Get the global context

set_context :: Context -> Elab' aux () Source #

Update the context. (should only be used for adding temporary definitions or all sorts of stuff could go wrong)

get_term :: Elab' aux Term Source #

get the proof term

update_term :: (Term -> Term) -> Elab' aux () Source #

modify the proof term

get_env :: Elab' aux Env Source #

get the local context at the currently in focus hole

get_recents :: Elab' aux [Name] Source #

Return recently solved names (that is, the names solved since the last call to get_recents)

goal :: Elab' aux Type Source #

get the current goal type

get_guess :: Elab' aux Term Source #

Get the guess at the current hole, if there is one

get_type :: Raw -> Elab' aux Type Source #

Typecheck locally

get_deferred :: Elab' aux [Name] Source #

get holes we've deferred for later definition

get_implementations :: Elab' aux [Name] Source #

get implementation argument names

get_autos :: Elab' aux [(Name, ([FailContext], [Name]))] Source #

get auto argument names

unique_hole :: Name -> Elab' aux Name Source #

given a desired hole name, return a unique hole name

elog :: String -> Elab' aux () Source #

attack :: Elab' aux () Source #

claim :: Name -> Raw -> Elab' aux () Source #

claimFn :: Name -> Name -> Raw -> Elab' aux () Source #

unifyGoal :: Raw -> Elab' aux () Source #

unifyTerms :: Raw -> Raw -> Elab' aux () Source #

exact :: Raw -> Elab' aux () Source #

fill :: Raw -> Elab' aux () Source #

match_fill :: Raw -> Elab' aux () Source #

prep_fill :: Name -> [Name] -> Elab' aux () Source #

solve :: Elab' aux () Source #

regret :: Elab' aux () Source #

compute :: Elab' aux () Source #

eval_in :: Raw -> Elab' aux () Source #

check_in :: Raw -> Elab' aux () Source #

intro :: Maybe Name -> Elab' aux () Source #

introTy :: Raw -> Maybe Name -> Elab' aux () Source #

letbind :: Name -> RigCount -> Raw -> Raw -> Elab' aux () Source #

expandLet :: Name -> Term -> Elab' aux () Source #

rewrite :: Raw -> Elab' aux () Source #

induction :: Raw -> Elab' aux () Source #

casetac :: Raw -> Elab' aux () Source #

equiv :: Raw -> Elab' aux () Source #

patvar :: Name -> Elab' aux () Source #

Turn the current hole into a pattern variable with the provided name, made unique if not the same as the head of the hole queue

patvar' :: Name -> Elab' aux () Source #

Turn the current hole into a pattern variable with the provided name, but don't make MNs unique.

patbind :: Name -> RigCount -> Elab' aux () Source #

focus :: Name -> Elab' aux () Source #

movelast :: Name -> Elab' aux () Source #

dotterm :: Elab' aux () Source #

zipHere :: Elab' aux () Source #

Set the zipper in the proof state to point at the current sub term (This currently happens automatically, so this will have no effect...)

defer :: [Name] -> [Name] -> Name -> Elab' aux Name Source #

deferType :: Name -> Raw -> [Name] -> Elab' aux () Source #

autoArg :: Name -> Elab' aux () Source #

setinj :: Name -> Elab' aux () Source #

undo :: Elab' aux () Source #

prepare_apply Source #

Arguments

:: Raw

The operation being applied

-> [Bool]

Whether arguments are implicit

-> Elab' aux [(Name, Name)]

The names of the arguments and their holes to be filled with elaborated argument values

Prepare to apply a function by creating holes to be filled by the arguments

apply Source #

Arguments

:: Raw

The operator to apply

-> [(Bool, Int)]

For each argument, whether to attempt to solve it and the priority in which to do so

-> Elab' aux [(Name, Name)] 

Apply an operator, solving some arguments by unification or matching.

match_apply Source #

Arguments

:: Raw

The operator to apply

-> [(Bool, Int)]

For each argument, whether to attempt to solve it and the priority in which to do so

-> Elab' aux [(Name, Name)] 

Apply an operator, solving some arguments by unification or matching.

apply' :: (Raw -> Elab' aux ()) -> Raw -> [(Bool, Int)] -> Elab' aux [(Name, Name)] Source #

apply2 :: Raw -> [Maybe (Elab' aux ())] -> Elab' aux () Source #

apply_elab :: Name -> [Maybe (Int, Elab' aux ())] -> Elab' aux () Source #

simple_app :: Bool -> Elab' aux () -> Elab' aux () -> String -> Elab' aux () Source #

infer_app :: Bool -> Elab' aux () -> Elab' aux () -> String -> Elab' aux () Source #

dep_app :: Elab' aux () -> Elab' aux () -> String -> Elab' aux () Source #

no_errors :: Elab' aux () -> Maybe Err -> Elab' aux () Source #

try :: Elab' aux a -> Elab' aux a -> Elab' aux a Source #

handleError :: (Err -> Bool) -> Elab' aux a -> Elab' aux a -> Elab' aux a Source #

try' :: Elab' aux a -> Elab' aux a -> Bool -> Elab' aux a Source #

tryCatch :: Elab' aux a -> (Err -> Elab' aux a) -> Elab' aux a Source #

tryWhen :: Bool -> Elab' aux a -> Elab' aux a -> Elab' aux a Source #

tryAll :: [(Elab' aux a, Name)] -> Elab' aux a Source #

tryAll' :: Bool -> [(Elab' aux a, Name)] -> Elab' aux a Source #

prunStateT :: Int -> Bool -> [a] -> Maybe [b] -> StateT (ElabState t) TC t1 -> ElabState t -> TC ((t1, Int, Fails), ElabState t) Source #

dumpprobs :: Show a1 => [(a2, b, c, a1)] -> [Char] Source #