summaryrefslogtreecommitdiff
path: root/src/dex.hs
diff options
context:
space:
mode:
authorDougal Maclaurin <dougalm@google.com>2020-12-19 23:44:20 -0500
committerDougal Maclaurin <dougalm@google.com>2020-12-20 00:03:13 -0500
commit5dc6a6f7b89d2ad371994b1e56fe96d680ffde0b (patch)
tree275d5f212ce78341baaa109d6580a570b379731c /src/dex.hs
parentd8540257c8e00c9d9e86f4b53190052b5a145b68 (diff)
Add an IO effect, modeled as `{State World}` with a special `World` token.
The goal is to let us sequence effectful FFI calls, without worrying about reordering and DCE, and then wrap the sequence in `unsafePerformIO` to expose it as a pure function.
Diffstat (limited to 'src/dex.hs')
-rw-r--r--src/dex.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dex.hs b/src/dex.hs
index 9c36c9ae..c0b73f6d 100644
--- a/src/dex.hs
+++ b/src/dex.hs
@@ -62,7 +62,7 @@ runMode evalMode preludeFile opts = do
exportFunctions objPath exportedFuns env opts
evalPrelude :: EvalConfig -> Maybe FilePath -> IO TopEnv
-evalPrelude opts fname = flip execStateT mempty $ do
+evalPrelude opts fname = flip execStateT initTopEnv $ do
source <- case fname of
Nothing -> return $ preludeSource
Just path -> liftIO $ readFile path