diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-08-05 10:54:42 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-08-05 10:54:42 +0200 |
commit | 5597e2f90b1e093a3b4dd110a84d40173e9abc77 (patch) | |
tree | f3d6e5e53efd1bcc56502b0470a33e39a17bf024 | |
parent | 63880f58258ed84a2f2b15e5acf1dc699912d0d9 (diff) | |
download | events-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.hs | 16 |
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 | |||
43 | evalExpr (EApp (ELam (EPri f)) a) = evalExpr . f $ evalExpr a | 43 | evalExpr (EApp (ELam (EPri f)) a) = evalExpr . f $ evalExpr a |
44 | evalExpr (EApp f a) = evalExpr $ beta a (evalExpr f) | 44 | evalExpr (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 | |||
52 | type family Ctx m f where | 46 | type 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 | ||
61 | class Bindable m b where | 55 | class 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 | ||
64 | instance ((Val m b) ~ (m b), Applicative m, Bindable m c) => Bindable m (m b -> c) where | 58 | instance ((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 | ||
68 | instance {-# OVERLAPPABLE #-} (Val m b ~ m b, Ctx m (m b) ~ '[], Fin m (m b) ~ b) => Bindable m (m b) where | 62 | instance {-# 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 .) |