Skip to content

Instantly share code, notes, and snippets.

@jdegoes
Created June 4, 2014 20:01
Show Gist options
  • Save jdegoes/0da704c327527bae0cc4 to your computer and use it in GitHub Desktop.
Save jdegoes/0da704c327527bae0cc4 to your computer and use it in GitHub Desktop.
Or else operator for Scalaz
implicit class AnyOps[A](value: A) {
def ?: [B](left: Option[B]): A \/ B = left.map(\/-(_)).getOrElse(-\/(value))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment