Skip to content

Instantly share code, notes, and snippets.

@phdoerfler
Created June 4, 2016 18:00
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 phdoerfler/9aef4af72236a453da2c06d15f9f84a6 to your computer and use it in GitHub Desktop.
Save phdoerfler/9aef4af72236a453da2c06d15f9f84a6 to your computer and use it in GitHub Desktop.
object GhettoValidation {
implicit class Optionator[A](val a: A) extends AnyVal {
def iff(f: => Boolean): Option[A] =
if (f) Some(a) else None
}
}
@asflierl
Copy link

asflierl commented Jun 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment