summaryrefslogtreecommitdiff
path: root/lec07/Editor.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lec07/Editor.hs')
-rw-r--r--lec07/Editor.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/lec07/Editor.hs b/lec07/Editor.hs
index 8f35414..8271118 100644
--- a/lec07/Editor.hs
+++ b/lec07/Editor.hs
@@ -10,6 +10,7 @@ import Buffer
import Control.Exception
import Control.Monad.State
+import Control.Monad (when, zipWithM_)
import Control.Applicative
import Control.Arrow (first, second)
@@ -35,7 +36,7 @@ commands = map show [View, Edit, Next, Prev, Quit]
-- Editor monad
newtype Editor b a = Editor (StateT (b,Int) IO a)
- deriving (Functor, Monad, MonadIO, MonadState (b,Int))
+ deriving (Functor, Applicative, Monad, MonadIO, MonadState (b,Int))
runEditor :: Buffer b => Editor b a -> b -> IO a
runEditor (Editor e) b = evalStateT e (b,0)