duet/examples/terminal.hs
2019-11-19 11:00:40 +00:00

10 lines
209 B
Haskell

data Terminal a
= GetLine (String -> Terminal a)
| PutStrLn String (Terminal a)
| Pure a
main =
PutStrLn
"Please enter your name: "
(GetLine (\line -> PutStrLn (append "Hello, " line) (Pure 0)))