如何在提示(Language.Haskell.Interpreter)中强制解释模式?
我有这个代码:
module Main where
import Language.Haskell.Interpreter
import Control.Monad
main = do
res <- runInterpreter (test "test")
case res of
Left e -> putStrLn (show e)
Right t -> putStrLn (show t)
return ()
test :: String -> Interpreter ()
test mname =
do
loadModules [mname ++ ".hs"]
setTopLevelModules ["Main"]
将导致(基于此处的答案):
NotAllowed "These modules are not interpreted:\nMain\n"
仅当 GHC 找到 test.o 时!
我试过了
unsafeSetGhcOption ("-fbyte-code")