From 3bd075759e68b6019e9d5896b1c889b7d5fbb967 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 4 Jun 2024 13:43:58 +0200 Subject: Main: Control.Monad.{Error => Except} --- src/Main.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 7d263e3..3c62184 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -17,7 +17,7 @@ import System.IO import GHC.Stats (getRTSStats) -import Control.Monad.Error +import Control.Monad.Except import Control.Monad.Reader import Control.Monad.State import Control.Monad.Writer @@ -196,9 +196,6 @@ data ExecError = UnhandledInputError String | OtherError String -instance Error ExecError where - noMsg = OtherError "something went wrong" - prettyError :: ExecError -> String @@ -213,7 +210,7 @@ prettyError (OtherError s) = newtype VT a = VT (ReaderT VTConfig - (ErrorT ExecError + (ExceptT ExecError (WriterT [String] (StateT VTState IO ))) @@ -233,7 +230,7 @@ runVT :: VTConfig -> VTState -> VT a -> IO ((Either ExecError a, [String]), VTState) runVT cf st (VT a) = - runStateT (runWriterT (runErrorT (runReaderT a cf))) st + runStateT (runWriterT (runExceptT (runReaderT a cf))) st -- cgit v1.2.3