Skip to content

Instantly share code, notes, and snippets.

@yuroyoro
Created July 27, 2011 07:58
Show Gist options
  • Save yuroyoro/1108890 to your computer and use it in GitHub Desktop.
Save yuroyoro/1108890 to your computer and use it in GitHub Desktop.
たっぷるたっぷる
trait TupleOps[A,B,C] {
val tuple:(A,B,C)
def head:A = tuple._1
def tail:(B,C) = (tuple._2, tuple._3)
}
implicit def tupleOps[A,B,C](t:(A,B,C)) = new TupleOps[A,B,C]{ val tuple = t }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment