From 7993c4c6cb3536f25cde7686535ebc00242a6bcd Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Fri, 26 Sep 2025 20:00:08 +0200 Subject: fix given code of lecture 7 due to breaking changes in haskell (thanks Giacomo Cavalieri!! :D) --- lec07/Editor.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lec07/Editor.hs') 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) -- cgit v1.2.3