This is a version of my “Coin Flip” games that uses the
Cats IO
monad. I created it to show how you can write
the game in a for
expression that uses recursion. The
IO
monad helps you use all of the I/O functions in
the for
expression.
For more information about this project, see my book, Learning Functional Programming in Scala.
Alvin Alexander
http://alvinalexander.com