Skip to content

Instantly share code, notes, and snippets.

View PaulAtBanno's full-sized avatar

Paul Snively PaulAtBanno

View GitHub Profile
@PaulAtBanno
PaulAtBanno / Flip.scala
Created April 7, 2017 17:08
Tasks to Task of ValidationNel
import scalaz._, Scalaz._
import scalaz.concurrent.Task
object flip {
def flip: String = {
val rnd = new java.util.Random()
if (rnd.nextInt(2) == 1) {
"Heads"
} else {
throw new RuntimeException("Tails")