mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 12:14:26 +03:00
4f10bfcfd2
This is referred to in the documentation, so should be there
15 lines
309 B
Idris
15 lines
309 B
Idris
import Text.Readline
|
|
|
|
echoLoop : IO ()
|
|
echoLoop
|
|
= do Just x <- readline "> "
|
|
| Nothing => putStrLn "EOF"
|
|
putStrLn ("Read: " ++ x)
|
|
when (x /= "") $ addHistory x
|
|
if x /= "quit"
|
|
then echoLoop
|
|
else putStrLn "Done"
|
|
|
|
main : IO ()
|
|
main = echoLoop
|