mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-28 22:22:10 +03:00
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
|