summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2016-08-05 10:54:42 +0200
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2016-08-05 10:54:42 +0200
commit5597e2f90b1e093a3b4dd110a84d40173e9abc77 (patch)
treef3d6e5e53efd1bcc56502b0470a33e39a17bf024
parent63880f58258ed84a2f2b15e5acf1dc699912d0d9 (diff)
downloadevents-5597e2f90b1e093a3b4dd110a84d40173e9abc77.tar
events-5597e2f90b1e093a3b4dd110a84d40173e9abc77.tar.gz
events-5597e2f90b1e093a3b4dd110a84d40173e9abc77.tar.bz2
events-5597e2f90b1e093a3b4dd110a84d40173e9abc77.tar.xz
events-5597e2f90b1e093a3b4dd110a84d40173e9abc77.zip
rename lifting
-rw-r--r--events/src/Events/Spec/Eval.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/events/src/Events/Spec/Eval.hs b/events/src/Events/Spec/Eval.hs
index ddb32e4..9cfb7c1 100644
--- a/events/src/Events/Spec/Eval.hs
+++ b/events/src/Events/Spec/Eval.hs
@@ -43,12 +43,6 @@ evalExpr (ELam a) = a
43evalExpr (EApp (ELam (EPri f)) a) = evalExpr . f $ evalExpr a 43evalExpr (EApp (ELam (EPri f)) a) = evalExpr . f $ evalExpr a
44evalExpr (EApp f a) = evalExpr $ beta a (evalExpr f) 44evalExpr (EApp f a) = evalExpr $ beta a (evalExpr f)
45 45
46-- liftE :: (Val m a -> Val m b) -> Expr m (a ': ctx) b
47-- liftE = EPri . (EVal .)
48
49-- bindE :: (m a -> b) -> Expr m (a ': Ctx b) (Fin b)
50-- bindE f = liftE $ bindE . f
51
52type family Ctx m f where 46type family Ctx m f where
53 Ctx m (m a -> b) = (a ': Ctx m b) 47 Ctx m (m a -> b) = (a ': Ctx m b)
54 Ctx m a = '[] 48 Ctx m a = '[]
@@ -59,12 +53,12 @@ type family Fin m f where
59 Fin m a = a 53 Fin m a = a
60 54
61class Bindable m b where 55class Bindable m b where
62 bindE :: (Val m a -> b) -> Expr m (a ': Ctx m b) (Fin m b) 56 liftE :: (Val m a -> b) -> Expr m (a ': Ctx m b) (Fin m b)
63 57
64instance ((Val m b) ~ (m b), Applicative m, Bindable m c) => Bindable m (m b -> c) where 58instance ((Val m b) ~ (m b), Applicative m, Bindable m c) => Bindable m (m b -> c) where
65 bindE :: (Val m a -> m b -> c) -> Expr m (a ': b ': Ctx m c) (Fin m c) 59 liftE :: (Val m a -> m b -> c) -> Expr m (a ': b ': Ctx m c) (Fin m c)
66 bindE f = (EPri :: (Val m a -> Expr m (b ': Ctx m c) (Fin m c)) -> Expr m (a ': b ': Ctx m c) (Fin m c)) . ((bindE :: (Val m b -> c) -> Expr m (b ': Ctx m c) (Fin m c)) . ) $ f 60 liftE f = (EPri :: (Val m a -> Expr m (b ': Ctx m c) (Fin m c)) -> Expr m (a ': b ': Ctx m c) (Fin m c)) . ((liftE :: (Val m b -> c) -> Expr m (b ': Ctx m c) (Fin m c)) . ) $ f
67 61
68instance {-# OVERLAPPABLE #-} (Val m b ~ m b, Ctx m (m b) ~ '[], Fin m (m b) ~ b) => Bindable m (m b) where 62instance {-# OVERLAPPABLE #-} (Val m b ~ m b, Ctx m (m b) ~ '[], Fin m (m b) ~ b) => Bindable m (m b) where
69 bindE :: (Val m a -> Val m b) -> Expr m '[a] b 63 liftE :: (Val m a -> Val m b) -> Expr m '[a] b
70 bindE = EPri . (EVal .) 64 liftE = EPri . (EVal .)