E.g if I want to write
1 -> 2 match { case 1 -> 2 => \"matched\" case _ => \"not matched\" } // error: not found: value ->
I have just such a thing! I like it because I find it more readable in many cases.
object -> { def unapply[A, B](pair: (A, B)): Option[(A, B)] = Some(pair) }
Now you can do:
scala> val a -> b = 1 -> 2 a: Int = 1 b: Int = 2