idris-0.9.18.1: Functional Programming Language with Dependent Types

Safe HaskellNone
LanguageHaskell98

Idris.Core.Elaborate

Synopsis

Documentation

data ElabState aux Source

Constructors

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

Instances

Show aux => Show (ElabState aux) 

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

errAt :: String -> Name -> Elab' aux a -> Elab' aux a 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

elaborate :: Context -> Ctxt TypeInfo -> 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_instances :: Elab' aux [Name] Source

get instance argument names

get_autos :: Elab' aux [(Name, [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

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 -> 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 MN

patbind :: Name -> 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 -> Elab' aux () 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 :: Raw -> [(Bool, Int)] -> Elab' aux [(Name, Name)] Source

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

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

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

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

dumpprobs :: Show a => [(t, t1, t2, a)] -> [Char] Source