Idris2/tests/idris2/real002/Control/App/Console.idr
Edwin Brady a972778eab Add test script
They don't all pass yet, for minor reasons. Coming shortly...
Unfortunately the startup overhead for chez is really noticeable here!
2020-05-19 18:25:18 +01:00

18 lines
348 B
Idris

module Control.App.Console
import public Control.App
public export
interface Console e where
putStr : String -> App {l} e ()
getStr : App {l} e String
export
PrimIO e => Console e where
putStr str = primIO $ putStr str
getStr = primIO $ getLine
export
putStrLn : Console e => String -> App {l} e ()
putStrLn str = putStr (str ++ "\n")