idris-0.9.14.3: Functional Programming Language with Dependent Types

Safe HaskellNone
LanguageHaskell98

Idris.PartialEval

Synopsis

Documentation

partial_eval :: Context -> [(Name, Maybe Int)] -> [Either Term (Term, Term)] -> [Either Term (Term, Term)] Source

Partially evaluates given terms under the given context.

getSpecApps :: IState -> [Name] -> Term -> [(Name, [(PEArgType, Term)])] Source

Get specialised applications for a given function

specType :: [(PEArgType, Term)] -> Type -> (Type, [(PEArgType, Term)]) Source

Specialises the type of a partially evaluated TT function returning a pair of the specialised type and the types of expected arguments.

mkPE_TyDecl :: IState -> [(PEArgType, Term)] -> Type -> PTerm Source

Creates an Idris type declaration given current state and a specialised TT function application type. Can be used in combination with the output of specType.

mkPE_TermDecl :: IState -> Name -> Name -> [(PEArgType, Term)] -> [(PTerm, PTerm)] Source

Creates a new clause for a specialised function application

data PEArgType Source

Data type representing binding-time annotations for partial evaluation of arguments

Constructors

ImplicitS

Implicit static argument

ImplicitD

Implicit dynamic argument

ExplicitS

Explicit static argument

ExplicitD

Explicit dynamic argument

UnifiedD

Erasable dynamic argument (found under unification)