diff options
author | Dougal Maclaurin <dougalm@google.com> | 2020-12-19 23:44:20 -0500 |
---|---|---|
committer | Dougal Maclaurin <dougalm@google.com> | 2020-12-20 00:03:13 -0500 |
commit | 5dc6a6f7b89d2ad371994b1e56fe96d680ffde0b (patch) | |
tree | 275d5f212ce78341baaa109d6580a570b379731c /src/dex.hs | |
parent | d8540257c8e00c9d9e86f4b53190052b5a145b68 (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.hs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |