Idris2/libs/base/Language/Reflection.idr

31 lines
614 B
Idris
Raw Normal View History

2020-05-18 18:57:43 +03:00
module Language.Reflection
import public Language.Reflection.TT
import public Language.Reflection.TTImp
public export
data Elab : Type -> Type where
Pure : a -> Elab a
Bind : Elab a -> (a -> Elab b) -> Elab b
Log : Nat -> String -> Elab ()
2020-05-18 18:57:43 +03:00
-- Check a TTImp term against the current goal type
Check : TTImp -> Elab TT
2020-05-18 18:57:43 +03:00
mutual
export
Functor Elab where
map f e = do e' <- e
pure (f e')
export
Applicative Elab where
pure = Pure
f <*> a = do f' <- f
a' <- a
pure (f' a')
export
Monad Elab where
(>>=) = Bind