idris-0.9.17: Functional Programming Language with Dependent Types

Safe HaskellNone
LanguageHaskell98

Idris.ElabTerm

Synopsis

Documentation

data ElabMode Source

Constructors

ETyDecl 
ELHS 
ERHS 

Instances

data ElabResult Source

Constructors

ElabResult 

Fields

resultTerm :: Term

The term resulting from elaboration

resultMetavars :: [(Name, (Int, Maybe Name, Type))]

Information about new metavariables

resultCaseDecls :: [PDecl]

Deferred declarations as the meaning of case blocks

resultContext :: Context

The potentially extended context from new definitions

resultTyDecls :: [(Name, FC, [PArg], Type)]

Meta-info about the new type declarations

data ElabCtxt Source

Constructors

ElabCtxt 

Fields

e_inarg :: Bool
 
e_isfn :: Bool

Function part of application

e_guarded :: Bool
 
e_intype :: Bool
 
e_qq :: Bool
 
e_nomatching :: Bool

can't pattern match

elab :: IState -> ElabInfo -> ElabMode -> FnOpts -> Name -> PTerm -> ElabD () Source

Returns the set of declarations we need to add to complete the definition (most likely case blocks to elaborate) as well as declarations resulting from user tactic scripts (%runTactics)

resolveTC :: Bool -> Bool -> Int -> Term -> Name -> IState -> ElabD () Source

resTC' :: (Num a, Eq a) => [TT Name] -> Bool -> [Name] -> a -> Term -> Name -> IState -> StateT (ElabState EState) TC () Source

case_ :: Bool -> Bool -> IState -> Name -> PTerm -> ElabD () Source

reflm :: String -> Name Source

Prefix a name with the Language.Reflection namespace

reify :: IState -> Term -> ElabD PTactic Source

Reify tactics from their reflected representation

reifyTT :: Term -> ElabD Term Source

Reify terms from their reflected representation

reifyRaw :: Term -> ElabD Raw Source

Reify raw terms from their reflected representation

reflCall :: String -> [Raw] -> Raw Source

Create a reflected call to a named function/constructor

reflect :: Term -> Raw Source

Lift a term into its Language.Reflection.TT representation

reflectRaw :: Raw -> Raw Source

Lift a term into its Language.Reflection.Raw representation

reflectTTQuotePattern :: [Name] -> Term -> ElabD () Source

Convert a reflected term to a more suitable form for pattern-matching. In particular, the less-interesting bits are elaborated to _ patterns. This happens to NameTypes, universe levels, names that are bound but not used, and the type annotation field of the P constructor.

reflectBinderQuotePattern :: ([Name] -> a -> ElabD ()) -> [Name] -> Binder a -> ElabD () Source

reflectTTQuote :: [Name] -> Term -> Raw Source

Create a reflected TT term, but leave refs to the provided name intact

reflectNameQuotePattern :: Name -> ElabD () Source

Elaborate a name to a pattern. This means that NS and UN will be intact. MNs corresponding to will care about the string but not the number. All others become _.

reflectBinderQuote :: ([Name] -> a -> Raw) -> Name -> [Name] -> Binder a -> Raw Source

mkList :: Raw -> [Raw] -> Raw Source

reflectEnv :: Env -> Raw Source

Reflect the environment of a proof into a List (TTName, Binder TT)

rawBool :: Bool -> Raw Source

Reflect an error into the internal datatype of Idris -- TODO

rawCons :: Raw -> Raw -> Raw -> Raw Source

rawList :: Raw -> [Raw] -> Raw Source

rawPair :: (Raw, Raw) -> (Raw, Raw) -> Raw Source

reflectFC :: FC -> Raw Source

Reflect a file context

reifyReportPart :: Term -> Either Err ErrorReportPart Source

Attempt to reify a report part from TT to the internal representation. Not in Idris or ElabD monads because it should be usable from either.