[Make MyInterpret more configurable WRT loaded modules Joachim Breitner **20100904105502 Ignore-this: 50124829c4ae85b836833abb25fdc0cc ] hunk ./MyInterpret.hs 25 -modules = [ "Prelude", +defaultModules = [ "Prelude", hunk ./MyInterpret.hs 65 - setUseLanguageExtensions False + set [languageExtensions := []] hunk ./MyInterpret.hs 70 - -- no need for temporary files I hope - setInstalledModsAreInScopeQualified True + + if null mods + then do -- no need for temporary files I hope. Used by bff + set [installedModulesInScope := True ] + setImports defaultModules + else do -- Only these modules in scope. No Prelude either! + loadModules mods + set [installedModulesInScope := False ] + setImports imports hunk ./MyInterpret.hs 81 - - setImports modules + unsafeSetGhcOption "-fno-warn-warnings-deprecations" hunk ./MyInterpret.hs 84 - todo exp + ret <- todo exp + + -- Hopefully removes temporary files + reset + + return ret hunk ./MyInterpret.hs 124 -simpleInterpret :: String -> String -> IO String -simpleInterpret defs what = - myInterpreter eval $ +simpleInterpret :: [String] -> [String] -> String -> String -> IO String +simpleInterpret mods imports defs what = + myInterpreter mods imports eval $ hunk ./MyInterpret.hs 131 -simpleTypeOf :: String -> String -> IO String -simpleTypeOf defs what = - myInterpreter typeOf $ +simpleTypeOf :: [String] -> [String] -> String -> String -> IO String +simpleTypeOf mods imports defs what = + myInterpreter mods imports typeOf $