Created
June 4, 2014 20:01
-
-
Save jdegoes/0da704c327527bae0cc4 to your computer and use it in GitHub Desktop.
Or else operator for Scalaz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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