shithub: MicroHs

ref: 5d4c8718a6384d8a27e0bdbf09bc517ac87a4c26
dir: /tests/Readline.hs/

View raw version
module Readline(main) where
import Prelude
import System.Console.SimpleReadline

main :: IO ()
main = do
  putStrLn "Type 'quit' to quit."
  loop

loop :: IO ()
loop = do
  s <- getInputLineHist "hist.txt" "% "
  case s of
    Just "quit" -> putStrLn "Bye"
    _ -> do putStrLn $ showMaybe showString s; loop