From da78ec9ee36739fd09a54f25e9aa0a748b99fae6 Mon Sep 17 00:00:00 2001
From: hololeap <hololeap@protonmail.com>
Date: Thu, 27 Feb 2025 04:19:48 -0700
Subject: [PATCH 1/1] Replace Control.Monad.Error with Control.Monad.Except

Add Control.Monad and Control.Monad.Fix imports which are no longer
implicit in mtl-2.3

Remove mentions of Error and strMsg which were removed along with
Control.Monad.Error

Signed-off-by: hololeap <hololeap@protonmail.com>
--- a/src/Interpreter.hs
+++ b/src/Interpreter.hs
@@ -5,10 +5,12 @@ module Interpreter
    , MonadGraphGen(..), runNoGraphT
    )
 where
+import Control.Monad
+import Control.Monad.Fix
 import Control.Monad.Reader
 import Control.Monad.Writer
 import Control.Monad.State
-import Control.Monad.Error
+import Control.Monad.Except
 import Data.Maybe (isJust)
 import Data.Generics (everywhere, mkT)
 import Control.Applicative ((<$>),(<*>),(<$),(<*), Applicative(..), Alternative)
@@ -136,10 +138,10 @@ type Branch = (Path, Unifier, [Goal])
 type Path = [Integer] -- Used for generating graph output
 root = [] :: Path
 
-resolve :: (Functor m, MonadTrace m, Error e, MonadError e m) => Program -> [Goal] -> m [Unifier]
+resolve :: (Functor m, MonadTrace m, MonadError String m) => Program -> [Goal] -> m [Unifier]
 resolve program goals = runNoGraphT (resolve_ program goals)
 
-resolve_ :: (Functor m, MonadTrace m, Error e, MonadError e m, MonadGraphGen m) => Program -> [Goal] -> m [Unifier]
+resolve_ :: (Functor m, MonadTrace m, MonadError String m, MonadGraphGen m) => Program -> [Goal] -> m [Unifier]
 -- Yield all unifiers that resolve <goal> using the clauses from <program>.
 resolve_ program goals = map cleanup <$> runReaderT (resolve' 1 (root, [], goals) []) (createDB (builtins ++ program) ["false","fail"])   -- NOTE Is it a good idea to "hardcode" the builtins like this?
   where
@@ -233,7 +235,7 @@ resolve_ program goals = map cleanup <$> runReaderT (resolve' 1 (root, [], goals
          mapM_ (trace_ "Stack") stack
          let sig = signature nextGoal
          whenPredicateIsUnknown sig $ do
-            throwError $ strMsg $ "Unknown predicate: " ++ show sig
+            throwError $ "Unknown predicate: " ++ show sig
          bs <- getProtoBranches -- Branch generation happens in two phases so visualizers can pick what to display.
          let branches = do
                (p, u, newGoals) <- bs
-- 
2.45.3

