From https://github.com/sol/doctest/commit/77373c5d84cd5e59ea86ec30b9ada874f50fad9e
From: Alberto Fanton <alberto.fanton@protonmail.com>
Date: Sun, 22 Dec 2024 15:46:28 +0100
Subject: [PATCH] Add support for GHC 9.12

--- a/src/Extract.hs
+++ b/src/Extract.hs
@@ -55,7 +55,9 @@ import           GHC.Unit.Module.Graph
 
 -- | A wrapper around `SomeException`, to allow for a custom `Show` instance.
 newtype ExtractError = ExtractError SomeException
+#if __GLASGOW_HASKELL__ < 912
   deriving Typeable
+#endif
 
 instance Show ExtractError where
   show (ExtractError e) =
--- a/test/Language/Haskell/GhciWrapperSpec.hs
+++ b/test/Language/Haskell/GhciWrapperSpec.hs
@@ -78,7 +78,11 @@ spec = do
 
     it "shows exceptions" $ withInterpreter $ \ghci -> do
       ghci "import Control.Exception" `shouldReturn` ""
+#if __GLASGOW_HASKELL__ >= 912
+      ghci "throwIO DivideByZero" `shouldReturn` "*** Exception: divide by zero\n\nHasCallStack backtrace:\n  throwIO, called at <interactive>:25:1 in interactive:Ghci22\n\n"
+#else
       ghci "throwIO DivideByZero" `shouldReturn` "*** Exception: divide by zero\n"
+#endif
 
     it "shows exceptions (ExitCode)" $ withInterpreter $ \ghci -> do
       ghci "import System.Exit" `shouldReturn` ""
