Skip to content

Instantly share code, notes, and snippets.

@OleTraveler
Last active August 29, 2015 14:04
  • Select an option

Select an option

def maxTen(i: Int) =
if (i <= 10) \/-(i)
else "Must be less than ten"
def divisibleByTwo(i: Int) =
if (i % 2 == 0) == 0 \/-(i)
else "Must be divisable by two"
def whatType(input: Int): ???[NonEmptyList[String], Int] =
( parseInt(input) |@| divisibleByTow(input) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment