@@ -160,12 +160,14 @@ partial
160replWith : (state : a) -> (prompt : String) ->
160replWith : (state : a) -> (prompt : String) ->
161 (onInput : a -> String -> Maybe (String, a)) -> IO ()
161 (onInput : a -> String -> Maybe (String, a)) -> IO ()
162replWith acc prompt fn
162replWith acc prompt fn
163− = do putStr prompt
165+ else do putStr prompt
164− x <- getLine
166+ x <- getLine
165− case fn acc x of
167+ case fn acc x of
166− Just (out, acc') => do putStr out
168+ Just (out, acc') => do putStr out
167− replWith acc' prompt fn
169+ replWith acc' prompt fn
168− Nothing => pure ()
170+ Nothing => pure ()
170||| A basic read-eval-print loop
172||| A basic read-eval-print loop
171||| @ prompt the prompt to show
173||| @ prompt the prompt to show