@@ -160,12 +160,14 @@ partial
160160replWith : (state : a) -> (prompt : String) ->
161161 (onInput : a -> String -> Maybe (String, a)) -> IO ()
162162replWith acc prompt fn
163− = do putStr prompt
164− x <- getLine
165− case fn acc x of
166− Just (out, acc') => do putStr out
167− replWith acc' prompt fn
168− Nothing => pure ()
163+ = if !(fEOF stdin)
164+ then pure ()
165+ else do putStr prompt
166+ x <- getLine
167+ case fn acc x of
168+ Just (out, acc') => do putStr out
169+ replWith acc' prompt fn
170+ Nothing => pure ()
169171
170172||| A basic read-eval-print loop
171173||| @ prompt the prompt to show