diff options
| author | Edoardo La Greca | 2025-09-26 20:00:08 +0200 |
|---|---|---|
| committer | Edoardo La Greca | 2025-09-26 20:00:08 +0200 |
| commit | 7993c4c6cb3536f25cde7686535ebc00242a6bcd (patch) | |
| tree | c055c306b89b59e7e01af167437448a81a2abdac /lec07 | |
| parent | 3f68acafbaf6c5d8c5d340fd85a72db186140fa1 (diff) | |
fix given code of lecture 7 due to breaking changes in haskell (thanks Giacomo Cavalieri!! :D)
Diffstat (limited to 'lec07')
| -rw-r--r-- | lec07/Editor.hs | 3 |
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) |