on master help sign in
Idris-dev/samples/effects/ConsoleIO.idr
15 lines 330 B history raw
1module Main
3import Effects
4import Effect.StdIO
5import Effect.State
7hello : { [STATE Int, STDIO] } Eff ()
8hello = do putStr "Name? "
9 putStrLn ("Hello " ++ trim !getStr ++ "!")
10 update (+1)
11 putStrLn ("I've said hello to: " ++ show !get ++ " people")
12 hello
14main : IO ()
15main = run hello