idris-1.0: Functional Programming Language with Dependent Types

CopyrightLicense : BSD3
MaintainerThe Idris Community.
Safe HaskellNone
LanguageHaskell98

Idris.Reflection

Description

 

Synopsis

Documentation

data RErasure #

Constructors

RErased 
RNotErased 

Instances

data RFunArg #

Constructors

RFunArg 

Instances

data RTyDecl #

Constructors

RDeclare Name [RFunArg] Raw 

Instances

data RDatatype #

Constructors

RDatatype Name [RTyConArg] Raw [(Name, [RCtorArg], Raw)] 

data RFunClause a #

Constructors

RMkFunClause a a 
RMkImpossibleClause a 

Instances

data RFunDefn a #

Constructors

RDefineFun Name [RFunClause a] 

Instances

Show a => Show (RFunDefn a) # 

Methods

showsPrec :: Int -> RFunDefn a -> ShowS #

show :: RFunDefn a -> String #

showList :: [RFunDefn a] -> ShowS #

reflm :: String -> Name #

Prefix a name with the Language.Reflection namespace

tacN :: String -> Name #

Prefix a name with the Language.Reflection.Elab namespace

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

Reify tactics from their reflected representation

reifyPair :: (Term -> ElabD a) -> (Term -> ElabD b) -> Term -> ElabD (a, b) #

reifyList :: (Term -> ElabD a) -> Term -> ElabD [a] #

reifyTT :: Term -> ElabD Term #

Reify terms from their reflected representation

reifyRaw :: Term -> ElabD Raw #

Reify raw terms from their reflected representation

reifyTTBinder :: (Term -> ElabD a) -> Name -> Term -> ElabD (Binder a) #

reifyTTBinderApp :: (Term -> ElabD a) -> Name -> [Term] -> ElabD (Binder a) #

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

Create a reflected call to a named function/constructor

reflect :: Term -> Raw #

Lift a term into its Language.Reflection.TT representation

reflectRaw :: Raw -> Raw #

Lift a term into its Language.Reflection.Raw representation

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

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 ()) -> Raw -> [Name] -> Binder a -> ElabD () #

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

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

reflectNameQuotePattern :: Name -> ElabD () #

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 #

mkList :: Raw -> [Raw] -> Raw #

reflectEnv :: Env -> Raw #

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

rawBool :: Bool -> Raw #

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

rawNil :: Raw -> Raw #

rawCons :: Raw -> Raw -> Raw -> Raw #

rawList :: Raw -> [Raw] -> Raw #

rawPairTy :: Raw -> Raw -> Raw #

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

rawTripleTy :: Raw -> Raw -> Raw -> Raw #

Idris tuples nest to the right

rawTriple :: (Raw, Raw, Raw) -> (Raw, Raw, Raw) -> Raw #

reflectFC :: FC -> Raw #

Reflect a file context

reifyReportPart :: Term -> Either Err ErrorReportPart #

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.

reflectList :: Raw -> [Raw] -> Raw #

getArgs :: [PArg] -> Raw -> ([RFunArg], Raw) #

Apply Idris's implicit info to get a signature. The [PArg] should come from a lookup in idris_implicits on IState.

unApplyRaw :: Raw -> (Raw, [Raw]) #

buildFunDefns :: IState -> Name -> [RFunDefn Term] #

Build the reflected function definition(s) that correspond(s) to a provided unqualifed name

buildDatatypes :: IState -> Name -> [RDatatype] #

Build the reflected datatype definition(s) that correspond(s) to a provided unqualified name