@propensive
def fn[T](t: (T, T)): T = if (t._1 == t._2) t._1 else // …
;-)
Occasionally I want to write: def fn[T](t: (T, T)): T = t match { case (x, `x`) => x case _ => //... } But it won't happen. ;)
-
-
-
@viktorklang Yeah, that's what I *don't* want to write. ;) I remember odd results reusing identifiers in patterns when that was allowed... - Show replies
New conversation -
-
-
@propensive "... case (x, y) if x == y ... " is bearable. -
@venechka Oh, sure. ;) It would just feel infinitesimally more "compete" to be able to do my trick... - Show replies
New conversation -
-
-
@propensive Remember that you're going to need an Eq instance for that ;-)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@propensive pull request? -
@thecoda PR? There is no PR. - Show replies
New conversation -
-
-
@propensive Meh. case (x, y) if x == y => x is more explicit anyway.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.