Permalink
Browse files

fix prompt behaviour

  • Loading branch information...
1 parent af8d084 commit 50fe3568f44502d898b68540abba428e24503b04 @mikeplus64 committed Jan 28, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Language/Haskell/Repl.hs
@@ -78,9 +78,10 @@ prompt r xs x = do
(tr,ir) <- progress lazyResults
threadDelay p
killThread tr
- elems <- readIORef ir
- let hs = take elems xs
- ends (trimLines hs) `seq` putMVar final hs
+ lineCount <- readIORef ir
+ case take lineCount lazyResults of
+ [] -> putMVar final []
+ hs -> ends (trimLines hs) `seq` putMVar final hs
_ -> putMVar final (trimLines lazyResults)
fin <- takeMVar final

0 comments on commit 50fe356

Please sign in to comment.