diff options
author | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-04-16 14:45:25 +0000 |
---|---|---|
committer | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-04-16 14:45:25 +0000 |
commit | 92ec9e276b481844860a07f1e9e64dff2c4ce7f8 (patch) | |
tree | 7930a55bb4868ab45f98f80d0bdf57accf3f9e39 /src/library/scala/Tuple2.scala | |
parent | 374b34db53f480d51507a554abfe029ee20d1c2b (diff) | |
download | scala-92ec9e276b481844860a07f1e9e64dff2c4ce7f8.tar.gz scala-92ec9e276b481844860a07f1e9e64dff2c4ce7f8.tar.bz2 scala-92ec9e276b481844860a07f1e9e64dff2c4ce7f8.zip |
Improvements to genprod
Added uncurry to Function2, swap to Tuple2.
Diffstat (limited to 'src/library/scala/Tuple2.scala')
-rw-r--r-- | src/library/scala/Tuple2.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/library/scala/Tuple2.scala b/src/library/scala/Tuple2.scala index 57a36e02f6..a69fd6720e 100644 --- a/src/library/scala/Tuple2.scala +++ b/src/library/scala/Tuple2.scala @@ -9,11 +9,13 @@ // $Id$ -// generated by genprod on Tue Feb 05 21:30:06 CET 2008 +// generated by genprod on Wed Apr 16 16:26:09 CEST 2008 (with extra methods) package scala -/** Tuple2 is the canonical representation of a @see Product2 */ +/** Tuple2 is the canonical representation of a @see Product2 + * + */ case class Tuple2[+T1, +T2](_1:T1, _2:T2) extends Product2[T1, T2] { @@ -22,4 +24,8 @@ case class Tuple2[+T1, +T2](_1:T1, _2:T2) sb.append('(').append(_1).append(',').append(_2).append(')') sb.toString } + + /** Swap the elements of the tuple */ + def swap: Tuple2[T2,T1] = Tuple2(_2, _1) + } |