diff options
author | Burak Emir <emir@epfl.ch> | 2006-11-27 14:29:19 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-11-27 14:29:19 +0000 |
commit | ccf513fe443e842a2dd1ceababe173cda27f99c2 (patch) | |
tree | 755440f54708ad1a0838311ee1cc7ece73cbc4d8 /src/library/scala/Function1.scala | |
parent | 6538ff2bea57b2c14e4cb27a06e10c0dbe7081bb (diff) | |
download | scala-ccf513fe443e842a2dd1ceababe173cda27f99c2.tar.gz scala-ccf513fe443e842a2dd1ceababe173cda27f99c2.tar.bz2 scala-ccf513fe443e842a2dd1ceababe173cda27f99c2.zip |
more products, plus some static optimization in...
more products, plus some static optimization in pattern matcher
Diffstat (limited to 'src/library/scala/Function1.scala')
-rw-r--r-- | src/library/scala/Function1.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/library/scala/Function1.scala b/src/library/scala/Function1.scala index add41c8c58..f05437c1b6 100644 --- a/src/library/scala/Function1.scala +++ b/src/library/scala/Function1.scala @@ -1,3 +1,4 @@ + /* __ *\ ** ________ ___ / / ___ Scala API ** ** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL ** @@ -6,14 +7,14 @@ ** |/ ** \* */ +// generated on Mon Nov 27 15:01:28 CET 2006 (with fancy comment) (with extra methods) // $Id$ - package scala /** - * Function with 1 parameter. In the following example the definition of + * Function with 1 parameters. In the following example the definition of * <code>succ</code> is a shorthand for the anonymous class definition * <code>anonfun1</code>: * <pre> @@ -29,9 +30,11 @@ package scala * Console.println(anonfun1(0)) * }</pre> */ -trait Function1[-T0, +R] extends AnyRef { - def apply(v0: T0): R +trait Function1 [-T1, +R] extends AnyRef { + def apply(v1:T1): R override def toString() = "<function>" - def compose[A](g: A => T0): A => R = { x => apply(g(x)) } -} + def compose[A](g: A => T1): A => R = { x => apply(g(x)) } + def andThen[A](g: R => A): T1 => A = g compose this + +} |