@@ -10,8 +10,8 @@ import Control.Catchable
10Effect : Type
10Effect : Type
11Effect = Type -> Type -> Type -> Type
11Effect = Type -> Type -> Type -> Type
13−data EFF : Type where
13+data EFFECT : Type where
14− MkEff : Type -> Effect -> EFF
14+ MkEff : Type -> Effect -> EFFECT
16class Handler (e : Effect) (m : Type -> Type) where
16class Handler (e : Effect) (m : Type -> Type) where
17 handle : res -> (eff : e res res' t) -> (res' -> t -> m a) -> m a
17 handle : res -> (eff : e res res' t) -> (res' -> t -> m a) -> m a
@@ -28,12 +28,12 @@ using (xs : List a, ys : List a)
28 subListId {xs = Nil} = SubNil
28 subListId {xs = Nil} = SubNil
29 subListId {xs = x :: xs} = Keep subListId
29 subListId {xs = x :: xs} = Keep subListId
31−data Env : (m : Type -> Type) -> List EFF -> Type where
31+data Env : (m : Type -> Type) -> List EFFECT -> Type where
32 Nil : Env m Nil
32 Nil : Env m Nil
33 (::) : Handler eff m => a -> Env m xs -> Env m (MkEff a eff :: xs)
33 (::) : Handler eff m => a -> Env m xs -> Env m (MkEff a eff :: xs)
35data EffElem : (Type -> Type -> Type -> Type) -> Type ->
35data EffElem : (Type -> Type -> Type -> Type) -> Type ->
36− List EFF -> Type where
36+ List EFFECT -> Type where
37 Here : EffElem x a (MkEff a x :: xs)
37 Here : EffElem x a (MkEff a x :: xs)
38 There : EffElem x a xs -> EffElem x a (y :: xs)
38 There : EffElem x a xs -> EffElem x a (y :: xs)
@@ -73,8 +73,8 @@ findSubList (S n)
73 ((Try (Refine "Keep" `Seq` Solve)
73 ((Try (Refine "Keep" `Seq` Solve)
74 (Refine "Drop" `Seq` Solve)) `Seq` findSubList n))
74 (Refine "Drop" `Seq` Solve)) `Seq` findSubList n))
76−updateResTy : (xs : List EFF) -> EffElem e a xs -> e a b t ->
76+updateResTy : (xs : List EFFECT) -> EffElem e a xs -> e a b t ->
77− List EFF
77+ List EFFECT
78updateResTy {b} (MkEff a e :: xs) Here n = (MkEff b e) :: xs
78updateResTy {b} (MkEff a e :: xs) Here n = (MkEff b e) :: xs
79updateResTy (x :: xs) (There p) n = x :: updateResTy xs p n
79updateResTy (x :: xs) (There p) n = x :: updateResTy xs p n
@@ -83,7 +83,7 @@ infix 5 :::, :-, :=
83data LRes : lbl -> Type -> Type where
83data LRes : lbl -> Type -> Type where
84 (:=) : (x : lbl) -> res -> LRes x res
84 (:=) : (x : lbl) -> res -> LRes x res
86−(:::) : lbl -> EFF -> EFF
86+(:::) : lbl -> EFFECT -> EFFECT
87(:::) {lbl} x (MkEff r eff) = MkEff (LRes x r) eff
87(:::) {lbl} x (MkEff r eff) = MkEff (LRes x r) eff
@@ -97,7 +97,7 @@ relabel {x = MkEff a eff} l [v] = [l := v]
97-- the language of Effects
97-- the language of Effects
99data EffM : (m : Type -> Type) ->
99data EffM : (m : Type -> Type) ->
100− List EFF -> List EFF -> Type -> Type where
100+ List EFFECT -> List EFFECT -> Type -> Type where
101 value : a -> EffM m xs xs a
101 value : a -> EffM m xs xs a
102 ebind : EffM m xs xs' a -> (a -> EffM m xs' xs'' b) -> EffM m xs xs'' b
102 ebind : EffM m xs xs' a -> (a -> EffM m xs' xs'' b) -> EffM m xs xs'' b
103 effect : {a, b: _} -> {e : Effect} ->
103 effect : {a, b: _} -> {e : Effect} ->
@@ -114,7 +114,7 @@ data EffM : (m : Type -> Type) ->
114 EffM m xs xs' a
114 EffM m xs xs' a
115 (:-) : (l : ty) -> EffM m [x] [y] t -> EffM m [l ::: x] [l ::: y] t
115 (:-) : (l : ty) -> EffM m [x] [y] t -> EffM m [l ::: x] [l ::: y] t
117−-- Eff : List (EFF m) -> Type -> Type
117+-- Eff : List (EFFECT m) -> Type -> Type
120lift' : {default tactics { reflect findSubList 10; solve; }
120lift' : {default tactics { reflect findSubList 10; solve; }
@@ -192,7 +192,7 @@ runPure env prog = eff env prog (\env, r => r)
192runWith : (a -> m a) -> Env m xs -> EffM m xs xs' a -> m a
192runWith : (a -> m a) -> Env m xs -> EffM m xs xs' a -> m a
193runWith inj env prog = eff env prog (\env, r => inj r)
193runWith inj env prog = eff env prog (\env, r => inj r)
195−Eff : (Type -> Type) -> List EFF -> Type -> Type
195+Eff : (Type -> Type) -> List EFFECT -> Type -> Type
196Eff m xs t = EffM m xs xs t
196Eff m xs t = EffM m xs xs t
198-- some higher order things
198-- some higher order things