Commit c1395da6 authored by Vaibhav Sagar's avatar Vaibhav Sagar

Implement working :sprint

parent bea11742
......@@ -786,16 +786,16 @@ evalCommand _ (Directive GetDoc query) state = safely state $ do
results <- liftIO $ Hoogle.document query
return $ hoogleResults state results
evalCommand _ (Directive SPrint binding) state = safely state $ do
evalCommand _ (Directive SPrint binding) state = wrapExecution state $ do
flags <- getSessionDynFlags
contents <- liftIO $ newIORef []
let action = \_dflags _sev _srcspan _ppr _style msg -> modifyIORef' contents (showSDoc flags msg :)
let flags' = flags { log_action = action }
_ <- setSessionDynFlags flags'
Debugger.pprintClosureCommand False False binding
return
EvalOut
{ evalStatus = Success
, evalResult = mempty
, evalState = state
, evalPager = []
, evalMsgs = []
}
_ <- setSessionDynFlags flags
sprint <- liftIO $ readIORef contents
return $ formatType (unlines sprint)
evalCommand output (Statement stmt) state = wrapExecution state $ evalStatementOrIO output state
(CapturedStmt stmt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment