idris-0.9.15.1: Functional Programming Language with Dependent Types

Safe HaskellNone

Idris.Core.Evaluate

Synopsis

Documentation

normaliseC :: Context -> Env -> TT Name -> TT NameSource

Normalise fully type checked terms (so, assume all names/let bindings resolved)

rt_simplify :: Context -> Env -> TT Name -> TT NameSource

Simplify for run-time (i.e. basic inlining)

simplify :: Context -> Env -> TT Name -> TT NameSource

Like normalise, but we only reduce functions that are marked as okay to inline (and probably shouldn't reduce lets?) 20130908: now only used to reduce for totality checking. Inlining should be done elsewhere.

specialise :: Context -> Env -> [(Name, Int)] -> TT Name -> (TT Name, [(Name, Int)])Source

hnf :: Context -> Env -> TT Name -> TT NameSource

Reduce a term to head normal form

convEq :: Context -> [Name] -> TT Name -> TT Name -> StateT UCs (TC' Err) BoolSource

convEq' :: Context -> [Name] -> TT Name -> TT Name -> TC' Err BoolSource

data Def Source

A definition is either a simple function (just an expression with a type), a constant, which could be a data or type constructor, an axiom or as an yet undefined function, or an Operator. An Operator is a function which explains how to reduce. A CaseOp is a function defined by a simple case tree

Constructors

Function !Type !Term 
TyDecl NameType !Type 
Operator Type Int ([Value] -> Maybe Value) 
CaseOp CaseInfo !Type ![Type] ![Either Term (Term, Term)] ![([Name], Term, Term)] !CaseDefs 

Instances

data CaseInfo Source

Constructors

CaseInfo 

Fields

case_inlinable :: Bool
 
tc_dictionary :: Bool
 

Instances

data CaseDefs Source

Constructors

CaseDefs 

Fields

cases_totcheck :: !([Name], SC)
 
cases_compiletime :: !([Name], SC)
 
cases_inlined :: !([Name], SC)
 
cases_runtime :: !([Name], SC)
 

Instances

data Totality Source

The result of totality checking

Constructors

Total [Int]

well-founded arguments

Productive

productive

Partial PReason 
Unchecked 

Instances

data PReason Source

Reasons why a function may not be total

Instances

data MetaInformation Source

Constructors

EmptyMI

No meta-information

DataMI [Int]

Meta information for a data declaration with position of parameters

data Context Source

Contexts used for global definitions and for proof state. They contain universe constraints and existing definitions.

Instances

Show Context 

initContext :: ContextSource

The initial empty context

ctxtAlist :: Context -> [(Name, Def)]Source

Get the definitions from a context

addCasedef :: Name -> ErasureInfo -> CaseInfo -> Bool -> Bool -> Bool -> Bool -> [Type] -> [Int] -> [Either Term (Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> [([Name], Term, Term)] -> Type -> Context -> ContextSource

addOperator :: Name -> Type -> Int -> ([Value] -> Maybe Value) -> Context -> ContextSource

lookupTyName :: Name -> Context -> [(Name, Type)]Source

Get the list of pairs of fully-qualified names and their types that match some name

lookupTyNameExact :: Name -> Context -> Maybe (Name, Type)Source

Get the pair of a fully-qualified name and its type, if there is a unique one matching the name used as a key.

lookupTy :: Name -> Context -> [Type]Source

Get the types that match some name

lookupTyExact :: Name -> Context -> Maybe TypeSource

Get the single type that matches some name precisely

lookupTyEnv :: Name -> Env -> Maybe (Int, Type)Source

data Value Source

A HOAS representation of values

Instances

Eq Value 
Show Value 
Quote Value 

class Quote a whereSource

Methods

quote :: Int -> a -> Eval (TT Name)Source

Instances

initEval :: EvalStateSource

uniqueNameCtxt :: Context -> Name -> [Name] -> NameSource

Create a unique name given context and other existing names