Created
August 15, 2012 20:40
-
-
Save bjornharrtell/3363423 to your computer and use it in GitHub Desktop.
Trying to understand this...
This file contains 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
trait POf2[Bi[_, _]] { | |
def unapply[A, B](x: Bi[A, B]): Option[(A, B)] | |
} | |
implicit val TuplePOf2: POf2[Tuple2] = new POf2[Tuple2] { | |
def unapply[A, B](x: (A, B)) = Some(x) | |
} | |
(1, 4) match { case TuplePOf2(a, b) => a + b } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment