Last active
August 17, 2020 05:25
-
-
Save bukzor/2ee0ea6d1c454f000f3d01ce19018662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat.IO.readline<A: Type>(_: A): IO(String) | |
use line = IO.ask<String>("get_line", "") | |
IO.end<String>(line) | |
cat.go<A: Type>(io: IO(A)): IO(Unit) | |
get bind pure = IO.monad | |
let io1 = bind<,>(io, cat.IO.readline<>) | |
let io2 = bind<,>(io1, IO.print) | |
cat.go<>(io2) | |
cat: IO(Unit) | |
get bind pure = IO.monad | |
let io0 = pure<>(Unit.new) | |
cat.go<>(io0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment