diff options
author | Paul Phillips <paulp@improving.org> | 2009-12-02 04:59:54 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-12-02 04:59:54 +0000 |
commit | a030f0d8b3f19c88c857adbeea7e8712fb6a8c8e (patch) | |
tree | f7984d43a1e87ea1b093900bbeb3f34b2380bcd6 /src | |
parent | 87fa83d3f91bd151eaacdb98862af66021fd5b38 (diff) | |
download | scala-a030f0d8b3f19c88c857adbeea7e8712fb6a8c8e.tar.gz scala-a030f0d8b3f19c88c857adbeea7e8712fb6a8c8e.tar.bz2 scala-a030f0d8b3f19c88c857adbeea7e8712fb6a8c8e.zip |
Built out genprod to create a tuple method for ...
Built out genprod to create a tuple method for reach function alongside
its curry method. Generated new FunctionNs.
Diffstat (limited to 'src')
25 files changed, 219 insertions, 70 deletions
diff --git a/src/build/genprod.scala b/src/build/genprod.scala index 8abbe2d77b..c14ed8c40a 100644 --- a/src/build/genprod.scala +++ b/src/build/genprod.scala @@ -200,9 +200,12 @@ trait {className}{contraCoArgs} extends AnyRef {{ self => }} </file> } + + private def commaXs = xdefs.mkString("(", ", ", ")") + // (x1: T1) => (x2: T2) => (x3: T3) => (x4: T4) => apply(x1,x2,x3,x4) def shortCurry = { - val body = xdefs.mkString("apply(", ",", ")") + val body = "apply" + commaXs List.map2(xdefs, targs)("(%s: %s) => ".format(_, _)).mkString("", "", body) } @@ -210,24 +213,36 @@ trait {className}{contraCoArgs} extends AnyRef {{ self => def longCurry = (List.map2(xdefs, targs)(_ + ": " + _) drop 1).mkString( "(x1: T1) => ((", ", ", - ") => self.apply(%s)).curry".format(xdefs mkString ",") + ") => self.apply%s).curry".format(commaXs) ) // f(x1,x2,x3,x4,x5,x6) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6) def curryComment = { """ - /** f(%s) == (f.curry)%s + /** f%s == (f.curry)%s */ -""".format(xdefs mkString ",", xdefs map ("(" + _ + ")") mkString) +""".format(commaXs, xdefs map ("(" + _ + ")") mkString) + } + + def tupleMethod = { + def comment = """ + /* f%s == (f.tuple)(Tuple%d%s) + */ +""".format(commaXs, i, commaXs) + def body = "case Tuple%d%s => apply%s".format(i, commaXs, commaXs) + + comment + " def tuple: Tuple%d%s => R = {\n %s\n }\n".format(i, invariantArgs, body) } def curryMethod = { val body = if (i < 5) shortCurry else longCurry + + curryComment + " def curry: %s => R = {\n %s\n }\n".format( targs mkString " => ", body ) } - override def moreMethods = curryComment + curryMethod + override def moreMethods = curryMethod + tupleMethod } // object Function diff --git a/src/library/scala/Function.scala b/src/library/scala/Function.scala index e333959550..1a3397ed0b 100644 --- a/src/library/scala/Function.scala +++ b/src/library/scala/Function.scala @@ -36,6 +36,7 @@ object Function * @param f ... * @return ... */ + @deprecated("Use `f.curry` instead") def curried[a1, a2, b](f: (a1, a2) => b): a1 => a2 => b = { x1 => x2 => f(x1, x2) } @@ -45,18 +46,21 @@ object Function * @param f ... * @return ... */ + @deprecated("Use `f.curry` instead") def curried[a1, a2, a3, b](f: (a1, a2, a3) => b): a1 => a2 => a3 => b = { x1 => x2 => x3 => f(x1, x2, x3) } /** Currying for functions of arity 4. */ + @deprecated("Use `f.curry` instead") def curried[a1, a2, a3, a4, b](f: (a1, a2, a3, a4) => b): a1 => a2 => a3 => a4 => b = { x1 => x2 => x3 => x4 => f(x1, x2, x3, x4) } /** Currying for functions of arity 5. */ + @deprecated("Use `f.curry` instead") def curried[a1, a2, a3, a4, a5, b](f: (a1, a2, a3, a4, a5) => b): a1 => a2 => a3 => a4 => a5 => b = { x1 => x2 => x3 => x4 => x5 => f(x1, x2, x3, x4, x5) } @@ -92,6 +96,7 @@ object Function * @param f ... * @return ... */ + @deprecated("Use `f.tuple` instead") def tupled[a1, a2, b](f: (a1, a2) => b): Tuple2[a1, a2] => b = { case Tuple2(x1, x2) => f(x1, x2) } @@ -99,6 +104,7 @@ object Function /** Tupling for functions of arity 3. This transforms a function * of arity 3 into a unary function that takes a triple of arguments. */ + @deprecated("Use `f.tuple` instead") def tupled[a1, a2, a3, b](f: (a1, a2, a3) => b): Tuple3[a1, a2, a3] => b = { case Tuple3(x1, x2, x3) => f(x1, x2, x3) } @@ -106,6 +112,7 @@ object Function /** Tupling for functions of arity 4. This transforms a function * of arity 4 into a unary function that takes a 4-tuple of arguments. */ + @deprecated("Use `f.tuple` instead") def tupled[a1, a2, a3, a4, b](f: (a1, a2, a3, a4) => b): Tuple4[a1, a2, a3, a4] => b = { case Tuple4(x1, x2, x3, x4) => f(x1, x2, x3, x4) } @@ -113,6 +120,7 @@ object Function /** Tupling for functions of arity 5. This transforms a function * of arity 5 into a unary function that takes a 5-tuple of arguments. */ + @deprecated("Use `f.tuple` instead") def tupled[a1, a2, a3, a4, a5, b](f: (a1, a2, a3, a4, a5) => b): Tuple5[a1, a2, a3, a4, a5] => b = { case Tuple5(x1, x2, x3, x4, x5) => f(x1, x2, x3, x4, x5) } diff --git a/src/library/scala/Function0.scala b/src/library/scala/Function0.scala index fd02993a8c..c91322b120 100644 --- a/src/library/scala/Function0.scala +++ b/src/library/scala/Function0.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with fancy comment) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with fancy comment) package scala diff --git a/src/library/scala/Function1.scala b/src/library/scala/Function1.scala index 7cfd32304e..409447faa7 100644 --- a/src/library/scala/Function1.scala +++ b/src/library/scala/Function1.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with fancy comment) (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with fancy comment) (with extra methods) package scala diff --git a/src/library/scala/Function10.scala b/src/library/scala/Function10.scala index 4c3437dbb3..e52e528c72 100644 --- a/src/library/scala/Function10.scala +++ b/src/library/scala/Function10.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function10[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, +R] extends def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10): R override def toString() = "<function10>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) == (f.tuple)(Tuple10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)) + */ + def tuple: Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] => R = { + case Tuple10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) } } diff --git a/src/library/scala/Function11.scala b/src/library/scala/Function11.scala index 0d1f62b017..bcac4b2161 100644 --- a/src/library/scala/Function11.scala +++ b/src/library/scala/Function11.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function11[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, +R] ex def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11): R override def toString() = "<function11>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) == (f.tuple)(Tuple11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)) + */ + def tuple: Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11] => R = { + case Tuple11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) } } diff --git a/src/library/scala/Function12.scala b/src/library/scala/Function12.scala index e4975b03f0..67461a5ef4 100644 --- a/src/library/scala/Function12.scala +++ b/src/library/scala/Function12.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function12[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12): R override def toString() = "<function12>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) == (f.tuple)(Tuple12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)) + */ + def tuple: Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12] => R = { + case Tuple12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) } } diff --git a/src/library/scala/Function13.scala b/src/library/scala/Function13.scala index 7a05f655d6..9f5fe72bc6 100644 --- a/src/library/scala/Function13.scala +++ b/src/library/scala/Function13.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function13[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13): R override def toString() = "<function13>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) == (f.tuple)(Tuple13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)) + */ + def tuple: Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13] => R = { + case Tuple13(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) } } diff --git a/src/library/scala/Function14.scala b/src/library/scala/Function14.scala index 75cbbe8e3c..e40b0ee43f 100644 --- a/src/library/scala/Function14.scala +++ b/src/library/scala/Function14.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function14[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14): R override def toString() = "<function14>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) == (f.tuple)(Tuple14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)) + */ + def tuple: Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14] => R = { + case Tuple14(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) } } diff --git a/src/library/scala/Function15.scala b/src/library/scala/Function15.scala index 6b25c18474..fb44251ab9 100644 --- a/src/library/scala/Function15.scala +++ b/src/library/scala/Function15.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function15[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15): R override def toString() = "<function15>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) == (f.tuple)(Tuple15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)) + */ + def tuple: Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15] => R = { + case Tuple15(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) } } diff --git a/src/library/scala/Function16.scala b/src/library/scala/Function16.scala index a54ed01be3..69fc8bf74a 100644 --- a/src/library/scala/Function16.scala +++ b/src/library/scala/Function16.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function16[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16): R override def toString() = "<function16>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) == (f.tuple)(Tuple16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)) + */ + def tuple: Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16] => R = { + case Tuple16(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) } } diff --git a/src/library/scala/Function17.scala b/src/library/scala/Function17.scala index a20212919b..c5d510c1e3 100644 --- a/src/library/scala/Function17.scala +++ b/src/library/scala/Function17.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function17[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17): R override def toString() = "<function17>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) == (f.tuple)(Tuple17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)) + */ + def tuple: Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17] => R = { + case Tuple17(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) } } diff --git a/src/library/scala/Function18.scala b/src/library/scala/Function18.scala index 16b3c8ae03..4766037225 100644 --- a/src/library/scala/Function18.scala +++ b/src/library/scala/Function18.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function18[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18): R override def toString() = "<function18>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) == (f.tuple)(Tuple18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)) + */ + def tuple: Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18] => R = { + case Tuple18(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) } } diff --git a/src/library/scala/Function19.scala b/src/library/scala/Function19.scala index 85669db978..16325e4dfe 100644 --- a/src/library/scala/Function19.scala +++ b/src/library/scala/Function19.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function19[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19): R override def toString() = "<function19>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) == (f.tuple)(Tuple19(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)) + */ + def tuple: Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19] => R = { + case Tuple19(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) } } diff --git a/src/library/scala/Function2.scala b/src/library/scala/Function2.scala index 8a792b4f0b..f8aed5aa5e 100644 --- a/src/library/scala/Function2.scala +++ b/src/library/scala/Function2.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with fancy comment) (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with fancy comment) (with extra methods) package scala @@ -39,10 +39,16 @@ trait Function2[-T1, -T2, +R] extends AnyRef { self => def apply(v1:T1,v2:T2): R override def toString() = "<function2>" - /** f(x1,x2) == (f.curry)(x1)(x2) + /** f(x1, x2) == (f.curry)(x1)(x2) */ def curry: T1 => T2 => R = { - (x1: T1) => (x2: T2) => apply(x1,x2) + (x1: T1) => (x2: T2) => apply(x1, x2) + } + + /* f(x1, x2) == (f.tuple)(Tuple2(x1, x2)) + */ + def tuple: Tuple2[T1, T2] => R = { + case Tuple2(x1, x2) => apply(x1, x2) } } diff --git a/src/library/scala/Function20.scala b/src/library/scala/Function20.scala index dbae793f1e..cd833ae032 100644 --- a/src/library/scala/Function20.scala +++ b/src/library/scala/Function20.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function20[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19,v20:T20): R override def toString() = "<function20>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) == (f.tuple)(Tuple20(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)) + */ + def tuple: Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20] => R = { + case Tuple20(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) } } diff --git a/src/library/scala/Function21.scala b/src/library/scala/Function21.scala index 5759319bf2..afe21c60ef 100644 --- a/src/library/scala/Function21.scala +++ b/src/library/scala/Function21.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function21[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19,v20:T20,v21:T21): R override def toString() = "<function21>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) == (f.tuple)(Tuple21(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)) + */ + def tuple: Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21] => R = { + case Tuple21(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) } } diff --git a/src/library/scala/Function22.scala b/src/library/scala/Function22.scala index 6233ec07df..5fc491e8ce 100644 --- a/src/library/scala/Function22.scala +++ b/src/library/scala/Function22.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function22[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9,v10:T10,v11:T11,v12:T12,v13:T13,v14:T14,v15:T15,v16:T16,v17:T17,v18:T18,v19:T19,v20:T20,v21:T21,v22:T22): R override def toString() = "<function22>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21)(x22) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9)(x10)(x11)(x12)(x13)(x14)(x15)(x16)(x17)(x18)(x19)(x20)(x21)(x22) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => T10 => T11 => T12 => T13 => T14 => T15 => T16 => T17 => T18 => T19 => T20 => T21 => T22 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21, x22: T22) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21, x22: T22) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) == (f.tuple)(Tuple22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)) + */ + def tuple: Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22] => R = { + case Tuple22(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) } } diff --git a/src/library/scala/Function3.scala b/src/library/scala/Function3.scala index 76c48215a5..1624d94d86 100644 --- a/src/library/scala/Function3.scala +++ b/src/library/scala/Function3.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function3[-T1, -T2, -T3, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3): R override def toString() = "<function3>" - /** f(x1,x2,x3) == (f.curry)(x1)(x2)(x3) + /** f(x1, x2, x3) == (f.curry)(x1)(x2)(x3) */ def curry: T1 => T2 => T3 => R = { - (x1: T1) => (x2: T2) => (x3: T3) => apply(x1,x2,x3) + (x1: T1) => (x2: T2) => (x3: T3) => apply(x1, x2, x3) + } + + /* f(x1, x2, x3) == (f.tuple)(Tuple3(x1, x2, x3)) + */ + def tuple: Tuple3[T1, T2, T3] => R = { + case Tuple3(x1, x2, x3) => apply(x1, x2, x3) } } diff --git a/src/library/scala/Function4.scala b/src/library/scala/Function4.scala index 21112a3345..1530671b27 100644 --- a/src/library/scala/Function4.scala +++ b/src/library/scala/Function4.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function4[-T1, -T2, -T3, -T4, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4): R override def toString() = "<function4>" - /** f(x1,x2,x3,x4) == (f.curry)(x1)(x2)(x3)(x4) + /** f(x1, x2, x3, x4) == (f.curry)(x1)(x2)(x3)(x4) */ def curry: T1 => T2 => T3 => T4 => R = { - (x1: T1) => (x2: T2) => (x3: T3) => (x4: T4) => apply(x1,x2,x3,x4) + (x1: T1) => (x2: T2) => (x3: T3) => (x4: T4) => apply(x1, x2, x3, x4) + } + + /* f(x1, x2, x3, x4) == (f.tuple)(Tuple4(x1, x2, x3, x4)) + */ + def tuple: Tuple4[T1, T2, T3, T4] => R = { + case Tuple4(x1, x2, x3, x4) => apply(x1, x2, x3, x4) } } diff --git a/src/library/scala/Function5.scala b/src/library/scala/Function5.scala index 1a310cca83..09d0712bbf 100644 --- a/src/library/scala/Function5.scala +++ b/src/library/scala/Function5.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function5[-T1, -T2, -T3, -T4, -T5, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5): R override def toString() = "<function5>" - /** f(x1,x2,x3,x4,x5) == (f.curry)(x1)(x2)(x3)(x4)(x5) + /** f(x1, x2, x3, x4, x5) == (f.curry)(x1)(x2)(x3)(x4)(x5) */ def curry: T1 => T2 => T3 => T4 => T5 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5) => self.apply(x1,x2,x3,x4,x5)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5) => self.apply(x1, x2, x3, x4, x5)).curry + } + + /* f(x1, x2, x3, x4, x5) == (f.tuple)(Tuple5(x1, x2, x3, x4, x5)) + */ + def tuple: Tuple5[T1, T2, T3, T4, T5] => R = { + case Tuple5(x1, x2, x3, x4, x5) => apply(x1, x2, x3, x4, x5) } } diff --git a/src/library/scala/Function6.scala b/src/library/scala/Function6.scala index 9be31515b4..720133166f 100644 --- a/src/library/scala/Function6.scala +++ b/src/library/scala/Function6.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function6[-T1, -T2, -T3, -T4, -T5, -T6, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6): R override def toString() = "<function6>" - /** f(x1,x2,x3,x4,x5,x6) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6) + /** f(x1, x2, x3, x4, x5, x6) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6) => self.apply(x1,x2,x3,x4,x5,x6)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6) => self.apply(x1, x2, x3, x4, x5, x6)).curry + } + + /* f(x1, x2, x3, x4, x5, x6) == (f.tuple)(Tuple6(x1, x2, x3, x4, x5, x6)) + */ + def tuple: Tuple6[T1, T2, T3, T4, T5, T6] => R = { + case Tuple6(x1, x2, x3, x4, x5, x6) => apply(x1, x2, x3, x4, x5, x6) } } diff --git a/src/library/scala/Function7.scala b/src/library/scala/Function7.scala index ce4e99f749..a8772c6b68 100644 --- a/src/library/scala/Function7.scala +++ b/src/library/scala/Function7.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function7[-T1, -T2, -T3, -T4, -T5, -T6, -T7, +R] extends AnyRef { self => def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7): R override def toString() = "<function7>" - /** f(x1,x2,x3,x4,x5,x6,x7) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7) + /** f(x1, x2, x3, x4, x5, x6, x7) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => self.apply(x1,x2,x3,x4,x5,x6,x7)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => self.apply(x1, x2, x3, x4, x5, x6, x7)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7) == (f.tuple)(Tuple7(x1, x2, x3, x4, x5, x6, x7)) + */ + def tuple: Tuple7[T1, T2, T3, T4, T5, T6, T7] => R = { + case Tuple7(x1, x2, x3, x4, x5, x6, x7) => apply(x1, x2, x3, x4, x5, x6, x7) } } diff --git a/src/library/scala/Function8.scala b/src/library/scala/Function8.scala index 995af11640..e9531d39e6 100644 --- a/src/library/scala/Function8.scala +++ b/src/library/scala/Function8.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function8[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, +R] extends AnyRef { sel def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8): R override def toString() = "<function8>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8) + /** f(x1, x2, x3, x4, x5, x6, x7, x8) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8) == (f.tuple)(Tuple8(x1, x2, x3, x4, x5, x6, x7, x8)) + */ + def tuple: Tuple8[T1, T2, T3, T4, T5, T6, T7, T8] => R = { + case Tuple8(x1, x2, x3, x4, x5, x6, x7, x8) => apply(x1, x2, x3, x4, x5, x6, x7, x8) } } diff --git a/src/library/scala/Function9.scala b/src/library/scala/Function9.scala index ebf8b17954..ed6afe7eeb 100644 --- a/src/library/scala/Function9.scala +++ b/src/library/scala/Function9.scala @@ -8,7 +8,7 @@ // $Id$ -// generated by genprod on Wed Jun 17 14:10:05 PDT 2009 (with extra methods) +// generated by genprod on Mon Nov 30 12:09:35 PST 2009 (with extra methods) package scala @@ -23,10 +23,16 @@ trait Function9[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, +R] extends AnyRef def apply(v1:T1,v2:T2,v3:T3,v4:T4,v5:T5,v6:T6,v7:T7,v8:T8,v9:T9): R override def toString() = "<function9>" - /** f(x1,x2,x3,x4,x5,x6,x7,x8,x9) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9) + /** f(x1, x2, x3, x4, x5, x6, x7, x8, x9) == (f.curry)(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9) */ def curry: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => R = { - (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => self.apply(x1,x2,x3,x4,x5,x6,x7,x8,x9)).curry + (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9)).curry + } + + /* f(x1, x2, x3, x4, x5, x6, x7, x8, x9) == (f.tuple)(Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9)) + */ + def tuple: Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9] => R = { + case Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9) } } |