Skip to content

Instantly share code, notes, and snippets.

@stasimus
Created June 10, 2012 21:50
Show Gist options
  • Save stasimus/2907456 to your computer and use it in GitHub Desktop.
Save stasimus/2907456 to your computer and use it in GitHub Desktop.
def validateAmmo(ammo: => Long): Validation[List[String]] = {
if (ammo > 0) Success[List[String]]()
else Failure(List("Negative ammo"))
}
def validateName(name: => String): Validation[List[String]] = {
if (!name.isEmpty) Success[List[String]]()
else Failure(List("Empty Name"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment