2019-08-24 19:41:11 +03:00
|
|
|
module Language.Reflection
|
|
|
|
|
2019-11-30 16:23:03 +03:00
|
|
|
import public Language.Reflection.TT
|
|
|
|
import public Language.Reflection.TTImp
|
2019-08-24 19:41:11 +03:00
|
|
|
|
|
|
|
public export
|
2019-12-05 21:58:53 +03:00
|
|
|
data Elab : Type -> Type where
|
|
|
|
Pure : a -> Elab a
|
|
|
|
Bind : Elab a -> (a -> Elab b) -> Elab b
|
2019-11-25 00:17:16 +03:00
|
|
|
|
2019-12-05 21:58:53 +03:00
|
|
|
Check : TTImp -> Elab a
|
|
|
|
|
|
|
|
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
|