diff --git a/CHANGES.markdown b/CHANGES.markdown
--- a/CHANGES.markdown
+++ b/CHANGES.markdown
@@ -1,3 +1,6 @@
+Changes in 0.22.1
+  - Add `Test.DocTest.Internal.Run.doctestWithRepl`
+
 Changes in 0.22.0
   - Export more internals
 
diff --git a/doctest.cabal b/doctest.cabal
--- a/doctest.cabal
+++ b/doctest.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.35.2.
+-- This file has been generated from package.yaml by hpack version 0.35.4.
 --
 -- see: https://github.com/sol/hpack
 
 name:           doctest
-version:        0.22.0
+version:        0.22.1
 synopsis:       Test interactive Haskell examples
 description:    `doctest` is a tool that checks [examples](https://www.haskell.org/haddock/doc/html/ch03s08.html#idm140354810775744)
                 and [properties](https://www.haskell.org/haddock/doc/html/ch03s08.html#idm140354810771856)
@@ -115,6 +115,7 @@
       NamedFieldPuns
       RecordWildCards
       DeriveFunctor
+      NoImplicitPrelude
   exposed-modules:
       Test.DocTest
       Test.DocTest.Internal.Extract
@@ -124,6 +125,7 @@
   other-modules:
       Extract
       GhcUtil
+      Imports
       Info
       Interpreter
       Language.Haskell.GhciWrapper
@@ -139,7 +141,6 @@
       Paths_doctest
   build-depends:
       base >=4.5 && <5
-    , base-compat >=0.7.0
     , code-page >=0.1
     , deepseq
     , directory
@@ -163,9 +164,9 @@
       NamedFieldPuns
       RecordWildCards
       DeriveFunctor
+      NoImplicitPrelude
   build-depends:
       base >=4.5 && <5
-    , base-compat >=0.7.0
     , code-page >=0.1
     , deepseq
     , directory
@@ -198,6 +199,7 @@
       UtilSpec
       Extract
       GhcUtil
+      Imports
       Info
       Interpreter
       Language.Haskell.GhciWrapper
@@ -226,6 +228,7 @@
       NamedFieldPuns
       RecordWildCards
       DeriveFunctor
+      NoImplicitPrelude
   c-sources:
       test/integration/with-cbits/foo.c
   build-tool-depends:
@@ -234,7 +237,6 @@
       HUnit
     , QuickCheck >=2.13.1
     , base >=4.5 && <5
-    , base-compat >=0.7.0
     , code-page >=0.1
     , deepseq
     , directory
diff --git a/driver/Main.hs b/driver/Main.hs
--- a/driver/Main.hs
+++ b/driver/Main.hs
@@ -1,4 +1,6 @@
 module Main (main) where
+
+import           Prelude
 import           Test.DocTest
 import           System.Environment (getArgs)
 
diff --git a/src/GhcUtil.hs b/src/GhcUtil.hs
--- a/src/GhcUtil.hs
+++ b/src/GhcUtil.hs
@@ -1,6 +1,8 @@
 {-# LANGUAGE CPP #-}
 module GhcUtil (withGhc) where
 
+import           Imports
+
 import           GHC.Paths (libdir)
 import           GHC
 #if __GLASGOW_HASKELL__ < 900
diff --git a/src/Imports.hs b/src/Imports.hs
new file mode 100644
--- /dev/null
+++ b/src/Imports.hs
@@ -0,0 +1,5 @@
+module Imports (module Imports) where
+
+import           Prelude as Imports
+import           Data.Monoid as Imports
+import           Control.Monad as Imports
diff --git a/src/Info.hs b/src/Info.hs
--- a/src/Info.hs
+++ b/src/Info.hs
@@ -7,7 +7,9 @@
 #endif
 ) where
 
-import           Data.List.Compat
+import           Imports
+
+import           Data.List
 import           System.Process
 import           System.IO.Unsafe
 
diff --git a/src/Interpreter.hs b/src/Interpreter.hs
--- a/src/Interpreter.hs
+++ b/src/Interpreter.hs
@@ -13,9 +13,10 @@
 , filterExpression
 ) where
 
+import           Imports
+
 import           System.Process
 import           System.Directory (getPermissions, executable)
-import           Control.Monad
 import           Control.Exception hiding (handle)
 import           Data.Char
 import           GHC.Paths (ghc)
@@ -38,28 +39,20 @@
 
   maybe False (== "YES") . lookup haveInterpreterKey <$> ghcInfo
 
--- | Run an interpreter session.
---
--- Example:
---
--- >>> withInterpreter [] $ \i -> eval i "23 + 42"
--- ...
--- "65\n"
 withInterpreter
-  :: [String]               -- ^ List of flags, passed to GHC
+  :: (String, [String])
   -> (Interpreter -> IO a)  -- ^ Action to run
   -> IO a                   -- ^ Result of action
-withInterpreter flags action = do
+withInterpreter (command, flags) action = do
   let
     args = flags ++ [
-        "--interactive"
-      , xTemplateHaskell
+        xTemplateHaskell
 #if __GLASGOW_HASKELL__ >= 802
       , "-fdiagnostics-color=never"
       , "-fno-diagnostics-show-caret"
 #endif
       ]
-  bracket (new defaultConfig{configGhci = ghc} args) close action
+  bracket (new defaultConfig{configGhci = command} args) close action
 
 xTemplateHaskell :: String
 xTemplateHaskell = "-XTemplateHaskell"
diff --git a/src/Language/Haskell/GhciWrapper.hs b/src/Language/Haskell/GhciWrapper.hs
--- a/src/Language/Haskell/GhciWrapper.hs
+++ b/src/Language/Haskell/GhciWrapper.hs
@@ -9,10 +9,11 @@
 , evalEcho
 ) where
 
+import           Imports
+
 import           System.IO hiding (stdin, stdout, stderr)
 import           System.Process
 import           System.Exit
-import           Control.Monad
 import           Control.Exception
 import           Data.List (isSuffixOf)
 import           Data.Maybe
diff --git a/src/Location.hs b/src/Location.hs
--- a/src/Location.hs
+++ b/src/Location.hs
@@ -1,6 +1,8 @@
 {-# LANGUAGE CPP #-}
 module Location where
 
+import           Imports
+
 import           Control.DeepSeq (deepseq, NFData(rnf))
 
 #if __GLASGOW_HASKELL__ < 900
diff --git a/src/Options.hs b/src/Options.hs
--- a/src/Options.hs
+++ b/src/Options.hs
@@ -14,16 +14,15 @@
 #endif
 ) where
 
-import           Prelude ()
-import           Prelude.Compat
+import           Imports
 
 import           Control.Monad.Trans.RWS (RWS, execRWS)
 import qualified Control.Monad.Trans.RWS as RWS
 
-import           Control.Monad (when)
-import           Data.List.Compat (stripPrefix)
-import           Data.Monoid (Endo (Endo))
+import           Data.List (stripPrefix)
 
+import           GHC.Paths (ghc)
+
 import           Info
 
 usage :: String
@@ -59,6 +58,7 @@
 , fastMode :: Bool
 , preserveIt :: Bool
 , verbose :: Bool
+, repl :: (String, [String])
 } deriving (Eq, Show)
 
 defaultConfig :: Config
@@ -67,6 +67,7 @@
 , fastMode = False
 , preserveIt = False
 , verbose = False
+, repl = (ghc, ["--interactive"])
 }
 
 nonInteractiveGhcOptions :: [String]
diff --git a/src/PackageDBs.hs b/src/PackageDBs.hs
--- a/src/PackageDBs.hs
+++ b/src/PackageDBs.hs
@@ -8,6 +8,8 @@
 #endif
 ) where
 
+import           Imports
+
 import System.Environment (getEnvironment)
 import System.FilePath (splitSearchPath, searchPathSeparator)
 
diff --git a/src/Parse.hs b/src/Parse.hs
--- a/src/Parse.hs
+++ b/src/Parse.hs
@@ -17,6 +17,8 @@
 #endif
 ) where
 
+import           Imports
+
 import           Data.Char (isSpace)
 import           Data.List (isPrefixOf, stripPrefix)
 import           Data.Maybe
diff --git a/src/Property.hs b/src/Property.hs
--- a/src/Property.hs
+++ b/src/Property.hs
@@ -8,6 +8,8 @@
 #endif
 ) where
 
+import           Imports
+
 import           Data.List
 import           Data.Maybe
 import           Data.Foldable
diff --git a/src/Run.hs b/src/Run.hs
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE CPP #-}
 module Run (
   doctest
+, doctestWithRepl
 
 , Config(..)
 , defaultConfig
@@ -18,10 +19,8 @@
 #endif
 ) where
 
-import           Prelude ()
-import           Prelude.Compat
+import           Imports
 
-import           Control.Monad
 import           System.Directory (doesFileExist, doesDirectoryExist, getDirectoryContents)
 import           System.Environment (getEnvironment)
 import           System.Exit (exitFailure, exitSuccess)
@@ -60,7 +59,10 @@
 -- If a directory is given, it is traversed to find all .hs and .lhs files
 -- inside of it, ignoring hidden entries.
 doctest :: [String] -> IO ()
-doctest args0 = case parseOptions args0 of
+doctest = doctestWithRepl (repl defaultConfig)
+
+doctestWithRepl :: (String, [String]) -> [String] -> IO ()
+doctestWithRepl repl args0 = case parseOptions args0 of
   Options.ProxyToGhc args -> rawSystem Interpreter.ghc args >>= E.throwIO
   Options.Output s -> putStr s
   Options.Result (Run warnings magicMode config) -> do
@@ -79,7 +81,7 @@
         packageDBArgs <- getPackageDBArgs
         addDistArgs <- getAddDistArgs
         return (addDistArgs $ packageDBArgs ++ expandedArgs)
-    doctestWith config{ghcOptions = opts}
+    doctestWith config{repl, ghcOptions = opts}
 
 -- | Expand a reference to a directory to all .hs and .lhs files within it.
 expandDirs :: String -> IO [String]
@@ -155,5 +157,5 @@
 
 runDocTests :: Config -> [Module [Located DocTest]] -> IO Result
 runDocTests Config{..} modules = do
-  Interpreter.withInterpreter ghcOptions $ \repl -> withCP65001 $ do
-    runModules fastMode preserveIt verbose repl modules
+  Interpreter.withInterpreter ((<> ghcOptions) <$> repl) $ \ interpreter -> withCP65001 $ do
+    runModules fastMode preserveIt verbose interpreter modules
diff --git a/src/Runner/Example.hs b/src/Runner/Example.hs
--- a/src/Runner/Example.hs
+++ b/src/Runner/Example.hs
@@ -3,6 +3,8 @@
 , mkResult
 ) where
 
+import           Imports
+
 import           Data.Char
 import           Data.List (isPrefixOf)
 import           Util
diff --git a/src/Util.hs b/src/Util.hs
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -1,4 +1,7 @@
 module Util where
+
+import           Imports
+
 import           Data.Char
 
 convertDosLineEndings :: String -> String
diff --git a/test/ExtractSpec.hs b/test/ExtractSpec.hs
--- a/test/ExtractSpec.hs
+++ b/test/ExtractSpec.hs
@@ -4,6 +4,8 @@
 
 module ExtractSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 import           Test.HUnit
 
diff --git a/test/InfoSpec.hs b/test/InfoSpec.hs
--- a/test/InfoSpec.hs
+++ b/test/InfoSpec.hs
@@ -1,5 +1,7 @@
 module InfoSpec (spec) where
 
+import           Imports
+
 import           Test.Hspec
 
 import           System.Process
diff --git a/test/InterpreterSpec.hs b/test/InterpreterSpec.hs
--- a/test/InterpreterSpec.hs
+++ b/test/InterpreterSpec.hs
@@ -1,14 +1,14 @@
-module InterpreterSpec (main, spec) where
+module InterpreterSpec (spec) where
 
-import           Prelude ()
-import           Prelude.Compat
+import           Imports
 
 import           Test.Hspec
 
-import           Interpreter (interpreterSupported, haveInterpreterKey, ghcInfo, withInterpreter, safeEval, filterExpression)
+import           Interpreter (Interpreter, interpreterSupported, haveInterpreterKey, ghcInfo, ghc, safeEval, filterExpression)
+import qualified Interpreter
 
-main :: IO ()
-main = hspec spec
+withInterpreter :: (Interpreter -> IO a) -> IO a
+withInterpreter = Interpreter.withInterpreter (Interpreter.ghc, ["--interactive"])
 
 spec :: Spec
 spec = do
@@ -23,10 +23,10 @@
         (||) <$> (== Just "YES") <*> (== Just "NO")
 
   describe "safeEval" $ do
-    it "evaluates an expression" $ withInterpreter [] $ \ghci -> do
+    it "evaluates an expression" $ withInterpreter $ \ ghci -> do
       Interpreter.safeEval ghci "23 + 42" `shouldReturn` Right "65\n"
 
-    it "returns Left on unterminated multiline command" $ withInterpreter [] $ \ghci -> do
+    it "returns Left on unterminated multiline command" $ withInterpreter $ \ ghci -> do
       Interpreter.safeEval ghci ":{\n23 + 42" `shouldReturn` Left "unterminated multi-line command"
 
   describe "filterExpression" $ do
diff --git a/test/Language/Haskell/GhciWrapperSpec.hs b/test/Language/Haskell/GhciWrapperSpec.hs
--- a/test/Language/Haskell/GhciWrapperSpec.hs
+++ b/test/Language/Haskell/GhciWrapperSpec.hs
@@ -1,6 +1,8 @@
 {-# LANGUAGE CPP #-}
 module Language.Haskell.GhciWrapperSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 import           System.IO.Silently
 
diff --git a/test/LocationSpec.hs b/test/LocationSpec.hs
--- a/test/LocationSpec.hs
+++ b/test/LocationSpec.hs
@@ -2,6 +2,8 @@
 
 module LocationSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 
 import           Location
diff --git a/test/MainSpec.hs b/test/MainSpec.hs
--- a/test/MainSpec.hs
+++ b/test/MainSpec.hs
@@ -2,6 +2,8 @@
 {-# LANGUAGE ConstraintKinds #-}
 module MainSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 import           Test.HUnit (assertEqual, Assertion)
 
diff --git a/test/OptionsSpec.hs b/test/OptionsSpec.hs
--- a/test/OptionsSpec.hs
+++ b/test/OptionsSpec.hs
@@ -1,8 +1,8 @@
 module OptionsSpec (spec) where
 
-import           Prelude ()
-import           Prelude.Compat
-import           Data.List.Compat
+import           Imports
+
+import           Data.List
 
 import           Test.Hspec
 import           Test.QuickCheck hiding (verbose)
diff --git a/test/PackageDBsSpec.hs b/test/PackageDBsSpec.hs
--- a/test/PackageDBsSpec.hs
+++ b/test/PackageDBsSpec.hs
@@ -1,12 +1,11 @@
 module PackageDBsSpec (main, spec) where
 
-import           Prelude ()
-import           Prelude.Compat
+import           Imports
 
 import qualified Control.Exception         as E
 import           Data.List                 (intercalate)
 import           PackageDBs
-import           System.Environment.Compat
+import           System.Environment
 import           System.FilePath           (searchPathSeparator)
 import           Test.Hspec
 
diff --git a/test/ParseSpec.hs b/test/ParseSpec.hs
--- a/test/ParseSpec.hs
+++ b/test/ParseSpec.hs
@@ -1,6 +1,8 @@
 {-# LANGUAGE OverloadedStrings #-}
 module ParseSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 import           Data.String
 import           Data.String.Builder (Builder, build)
diff --git a/test/PropertySpec.hs b/test/PropertySpec.hs
--- a/test/PropertySpec.hs
+++ b/test/PropertySpec.hs
@@ -1,14 +1,17 @@
 {-# LANGUAGE OverloadedStrings #-}
-module PropertySpec (main, spec) where
+module PropertySpec (spec) where
 
+import           Imports
+
 import           Test.Hspec
 import           Data.String.Builder
 
 import           Property
-import           Interpreter (withInterpreter)
+import           Interpreter (Interpreter)
+import qualified Interpreter
 
-main :: IO ()
-main = hspec spec
+withInterpreter :: (Interpreter -> IO a) -> IO a
+withInterpreter = Interpreter.withInterpreter (Interpreter.ghc, ["--interactive"])
 
 isFailure :: PropertyResult -> Bool
 isFailure (Failure _) = True
@@ -17,54 +20,54 @@
 spec :: Spec
 spec = do
   describe "runProperty" $ do
-    it "reports a failing property" $ withInterpreter [] $ \repl -> do
+    it "reports a failing property" $ withInterpreter $ \repl -> do
       runProperty repl "False" `shouldReturn` Failure "*** Failed! Falsified (after 1 test):"
 
-    it "runs a Bool property" $ withInterpreter [] $ \repl -> do
+    it "runs a Bool property" $ withInterpreter $ \repl -> do
       runProperty repl "True" `shouldReturn` Success
 
-    it "runs a Bool property with an explicit type signature" $ withInterpreter [] $ \repl -> do
+    it "runs a Bool property with an explicit type signature" $ withInterpreter $ \repl -> do
       runProperty repl "True :: Bool" `shouldReturn` Success
 
-    it "runs an implicitly quantified property" $ withInterpreter [] $ \repl -> do
+    it "runs an implicitly quantified property" $ withInterpreter $ \repl -> do
       runProperty repl "(reverse . reverse) xs == (xs :: [Int])" `shouldReturn` Success
 
     it "runs an implicitly quantified property even with GHC 7.4" $
       -- ghc will include a suggestion (did you mean `id` instead of `is`) in
       -- the error message
-      withInterpreter [] $ \repl -> do
+      withInterpreter $ \repl -> do
         runProperty repl "foldr (+) 0 is == sum (is :: [Int])" `shouldReturn` Success
 
-    it "runs an explicitly quantified property" $ withInterpreter [] $ \repl -> do
+    it "runs an explicitly quantified property" $ withInterpreter $ \repl -> do
       runProperty repl "\\xs -> (reverse . reverse) xs == (xs :: [Int])" `shouldReturn` Success
 
-    it "allows to mix implicit and explicit quantification" $ withInterpreter [] $ \repl -> do
+    it "allows to mix implicit and explicit quantification" $ withInterpreter $ \repl -> do
       runProperty repl "\\x -> x + y == y + x" `shouldReturn` Success
 
-    it "reports the value for which a property fails" $ withInterpreter [] $ \repl -> do
+    it "reports the value for which a property fails" $ withInterpreter $ \repl -> do
       runProperty repl "x == 23" `shouldReturn` Failure "*** Failed! Falsified (after 1 test):\n0"
 
-    it "reports the values for which a property that takes multiple arguments fails" $ withInterpreter [] $ \repl -> do
+    it "reports the values for which a property that takes multiple arguments fails" $ withInterpreter $ \repl -> do
       let vals x = case x of (Failure r) -> tail (lines r); _ -> error "Property did not fail!"
       vals `fmap` runProperty repl "x == True && y == 10 && z == \"foo\"" `shouldReturn` ["False", "0", show ("" :: String)]
 
-    it "defaults ambiguous type variables to Integer" $ withInterpreter [] $ \repl -> do
+    it "defaults ambiguous type variables to Integer" $ withInterpreter $ \repl -> do
       runProperty repl "reverse xs == xs" >>= (`shouldSatisfy` isFailure)
 
   describe "freeVariables" $ do
-    it "finds a free variables in a term" $ withInterpreter [] $ \repl -> do
+    it "finds a free variables in a term" $ withInterpreter $ \repl -> do
       freeVariables repl "x" `shouldReturn` ["x"]
 
-    it "ignores duplicates" $ withInterpreter [] $ \repl -> do
+    it "ignores duplicates" $ withInterpreter $ \repl -> do
       freeVariables repl "x == x" `shouldReturn` ["x"]
 
-    it "works for terms with multiple names" $ withInterpreter [] $ \repl -> do
+    it "works for terms with multiple names" $ withInterpreter $ \repl -> do
       freeVariables repl "\\z -> x + y + z == foo 23" `shouldReturn` ["x", "y", "foo"]
 
-    it "works for names that contain a prime" $ withInterpreter [] $ \repl -> do
+    it "works for names that contain a prime" $ withInterpreter $ \repl -> do
       freeVariables repl "x' == y''" `shouldReturn` ["x'", "y''"]
 
-    it "works for names that are similar to other names that are in scope" $ withInterpreter [] $ \repl -> do
+    it "works for names that are similar to other names that are in scope" $ withInterpreter $ \repl -> do
       freeVariables repl "length_" `shouldReturn` ["length_"]
 
   describe "parseNotInScope" $ do
diff --git a/test/RunSpec.hs b/test/RunSpec.hs
--- a/test/RunSpec.hs
+++ b/test/RunSpec.hs
@@ -1,8 +1,7 @@
 {-# LANGUAGE CPP #-}
 module RunSpec (main, spec) where
 
-import           Prelude ()
-import           Prelude.Compat
+import           Imports
 
 import           Test.Hspec
 import           System.Exit
@@ -10,7 +9,7 @@
 import qualified Control.Exception as E
 import           System.FilePath
 import           System.Directory (getCurrentDirectory, setCurrentDirectory)
-import           Data.List.Compat (isPrefixOf, sort)
+import           Data.List (isPrefixOf, sort)
 import           Data.Char
 
 import           System.IO.Silently
diff --git a/test/Runner/ExampleSpec.hs b/test/Runner/ExampleSpec.hs
--- a/test/Runner/ExampleSpec.hs
+++ b/test/Runner/ExampleSpec.hs
@@ -1,8 +1,7 @@
 {-# LANGUAGE OverloadedStrings #-}
 module Runner.ExampleSpec (main, spec) where
 
-import           Prelude ()
-import           Prelude.Compat
+import           Imports
 
 import           Data.String
 import           Test.Hspec
diff --git a/test/RunnerSpec.hs b/test/RunnerSpec.hs
--- a/test/RunnerSpec.hs
+++ b/test/RunnerSpec.hs
@@ -1,6 +1,8 @@
 {-# LANGUAGE CPP, OverloadedStrings #-}
 module RunnerSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 
 import           System.IO
diff --git a/test/UtilSpec.hs b/test/UtilSpec.hs
--- a/test/UtilSpec.hs
+++ b/test/UtilSpec.hs
@@ -1,5 +1,7 @@
 module UtilSpec (main, spec) where
 
+import           Imports
+
 import           Test.Hspec
 
 import           Util
