Skip to content

Commit

Permalink
Fix discrepancy between dynamic and static versions of notebook.
Browse files Browse the repository at this point in the history
  • Loading branch information
dougalm committed Jan 8, 2024
1 parent 8ef1fde commit bf4ccc4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/lib/Live/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ evalFileNonInteractive fname cfg initEnv = do
envRef <- newIORef initEnv
blocks <- parseSourceBlocks <$> readFileText fname
cellStates <- forM blocks \block -> do
env <- readIORef envRef
((exitStatus, newEnv), outs) <- captureLogs \logger ->
evalSourceBlockIO cfg logger env block
writeIORef envRef newEnv
return $ CellState block (exitStatusAsCellStatus exitStatus) outs
if isInert block
then return $ CellState block Inert mempty
else do
env <- readIORef envRef
((exitStatus, newEnv), outs) <- captureLogs \logger ->
evalSourceBlockIO cfg logger env block
writeIORef envRef newEnv
return $ CellState block (exitStatusAsCellStatus exitStatus) outs
runFreshNameT $ buildNodeList cellStates


-- === DAG diff state ===

-- We intend to make this an arbitrary Dag at some point but for now we just
Expand Down

0 comments on commit bf4ccc4

Please sign in to comment.