Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@OleTraveler
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OleTraveler/cd0a8b682dc78dd4e91e to your computer and use it in GitHub Desktop.
Save OleTraveler/cd0a8b682dc78dd4e91e to your computer and use it in GitHub Desktop.
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