2018-03-27から1日間の記事一覧
def getChar: IO[Char] = IO(System.in.read().toChar) def putChar(c: Char): IO[Unit] = IO(print(c)) def echo: IO[Unit] = for { c <- getChar _ <- putChar('\n') _ <- putChar(c) _ <- putChar('\n') } yield () def getLine: IO[List[Char]] = for { …