Safe Haskell | None |
---|---|
Language | Haskell98 |
Code related to Idris's reflection system. This module contains quoters and unquoters along with some supporting datatypes.
- data RArg
- data RTyDecl = RDeclare Name [RArg] Raw
- data RTyConArg
- data RDatatype = RDatatype Name [RTyConArg] Raw [(Name, Raw)]
- rArgToPArg :: RArg -> PArg
- data RFunClause
- data RFunDefn = RDefineFun Name [RFunClause]
- reflm :: String -> Name
- tacN :: String -> Name
- reify :: IState -> Term -> ElabD PTactic
- reifyApp :: IState -> Name -> [Term] -> ElabD PTactic
- reifyReportParts :: Term -> ElabD [ErrorReportPart]
- reifyTT :: Term -> ElabD Term
- reifyTTApp :: Name -> [Term] -> ElabD Term
- reifyRaw :: Term -> ElabD Raw
- reifyRawApp :: Name -> [Term] -> ElabD Raw
- reifyTTName :: Term -> ElabD Name
- reifyTTNameApp :: Name -> [Term] -> ElabD Name
- reifyTTNamespace :: Term -> ElabD [String]
- reifyTTNameType :: Term -> ElabD NameType
- reifyTTBinder :: (Term -> ElabD a) -> Name -> Term -> ElabD (Binder a)
- reifyTTBinderApp :: (Term -> ElabD a) -> Name -> [Term] -> ElabD (Binder a)
- reifyTTConst :: Term -> ElabD Const
- reifyTTConstApp :: Name -> Term -> ElabD Const
- reifyArithTy :: Term -> ElabD ArithTy
- reifyNativeTy :: Term -> ElabD NativeTy
- reifyIntTy :: Term -> ElabD IntTy
- reifyTTUExp :: Term -> ElabD UExp
- reflCall :: String -> [Raw] -> Raw
- reflect :: Term -> Raw
- reflectRaw :: Raw -> Raw
- claimTT :: Name -> ElabD Name
- reflectTTQuotePattern :: [Name] -> Term -> ElabD ()
- reflectRawQuotePattern :: [Name] -> Raw -> ElabD ()
- reflectBinderQuotePattern :: ([Name] -> a -> ElabD ()) -> [Name] -> Binder a -> ElabD ()
- reflectUniverse :: Universe -> Raw
- reflectTTQuote :: [Name] -> Term -> Raw
- reflectRawQuote :: [Name] -> Raw -> Raw
- reflectNameType :: NameType -> Raw
- reflectName :: Name -> Raw
- reflectSpecialName :: SpecialName -> Raw
- reflectNameQuotePattern :: Name -> ElabD ()
- reflectBinder :: Binder Term -> Raw
- reflectBinderQuote :: ([Name] -> a -> Raw) -> Name -> [Name] -> Binder a -> Raw
- mkList :: Raw -> [Raw] -> Raw
- reflectConstant :: Const -> Raw
- reflectUExp :: UExp -> Raw
- reflectEnv :: Env -> Raw
- rawBool :: Bool -> Raw
- rawNil :: Raw -> Raw
- rawCons :: Raw -> Raw -> Raw -> Raw
- rawList :: Raw -> [Raw] -> Raw
- rawPairTy :: Raw -> Raw -> Raw
- rawPair :: (Raw, Raw) -> (Raw, Raw) -> Raw
- reflectCtxt :: [(Name, Type)] -> Raw
- reflectErr :: Err -> Raw
- reflectFC :: FC -> Raw
- fromTTMaybe :: Term -> Maybe Term
- reflErrName :: String -> Name
- reifyReportPart :: Term -> Either Err ErrorReportPart
- reifyTyDecl :: Term -> ElabD RTyDecl
- reifyFunDefn :: Term -> ElabD RFunDefn
- envTupleType :: Raw
- buildDatatypes :: Context -> Ctxt TypeInfo -> Name -> [RDatatype]
- reflectDatatype :: RDatatype -> Raw
Documentation
rArgToPArg :: RArg -> PArg Source
reflm :: String -> Name Source
Prefix a name with the Language.Reflection namespace
Prefix a name with the Language.Reflection.Elab namespace
reifyReportParts :: Term -> ElabD [ErrorReportPart] Source
reifyTTName :: Term -> ElabD Name Source
reifyTTNamespace :: Term -> ElabD [String] Source
reifyTTNameType :: Term -> ElabD NameType Source
reifyTTConst :: Term -> ElabD Const Source
reifyArithTy :: Term -> ElabD ArithTy Source
reifyNativeTy :: Term -> ElabD NativeTy Source
reifyIntTy :: Term -> ElabD IntTy Source
reifyTTUExp :: Term -> ElabD UExp Source
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.
reflectRawQuotePattern :: [Name] -> Raw -> ElabD () Source
reflectUniverse :: Universe -> Raw Source
reflectTTQuote :: [Name] -> Term -> Raw Source
Create a reflected TT term, but leave refs to the provided name intact
reflectRawQuote :: [Name] -> Raw -> Raw Source
reflectNameType :: NameType -> Raw Source
reflectName :: Name -> Raw Source
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 _.
reflectBinder :: Binder Term -> Raw Source
reflectConstant :: Const -> Raw Source
reflectUExp :: UExp -> Raw Source
reflectEnv :: Env -> Raw Source
Reflect the environment of a proof into a List (TTName, Binder TT)
reflectCtxt :: [(Name, Type)] -> Raw Source
reflectErr :: Err -> Raw Source
fromTTMaybe :: Term -> Maybe Term Source
reflErrName :: String -> Name Source
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.
reifyTyDecl :: Term -> ElabD RTyDecl Source
reifyFunDefn :: Term -> ElabD RFunDefn Source
buildDatatypes :: Context -> Ctxt TypeInfo -> Name -> [RDatatype] Source
Build the reflected datatype definition(s) that correspond(s) to a provided unqualified name
reflectDatatype :: RDatatype -> Raw Source