summaryrefslogtreecommitdiff
path: root/src/library/scala/Function1.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-8858 doc: fix note about PartialFunction in Function0, F1 and F2vsalvis2015-06-171-5/+2
|
* SI-7841 Remove commented out AnyRef specialization from Function{0,1}.Jason Zaugg2013-09-151-1/+1
| | | | In a sign of decreased optimism about that facility.
* Updated copyright to 2013Carlo Dapor2013-01-021-1/+1
|
* Removes AnyRef specialization from libraryVlad Ureche2012-08-071-1/+1
| | | | | | | | | | As discussed in #999, #1025 and https://groups.google.com/forum/?hl=en&fromgroups#!topic/scala-internals/5P5TS9ZWe_w instrumented.jar is generated from the current source, there's no need for a bootstrap commit. Review by @paulp.
* @unspecialized annotation.Paul Phillips2012-04-281-4/+4
| | | | | | | | | Suppresses specialization on a per-method basis. I would have preferred to call it @nospecialize, but seeing as the positive form of the annotation is @specialized, that would have sown unnecessary grammatical confusion. @nospecialized sounds a bit too caveman for my tastes. "Grog no specialized! Grog generic!"
* Revert "Moved ancillary methods off specialized traits."Paul Phillips2012-04-271-0/+16
| | | | | | This reverts commit 1d0372f84f9a7325a47beb55169cc454895ef74b. I forgot about polymorphic dispatch. Have to seek another way.
* Moved ancillary methods off specialized traits.Paul Phillips2012-04-241-16/+0
| | | | | | | Moved compose/andThen off Function1, curried/tupled off Function2. Pushed Tuple2 zipped into auxiliary class. Created implicits to plaster over the changes. This drops several hundred classfiles and takes (unoptimized) scala-library.jar from 7.8 Mb to 7.4 Mb.
* Whitespace commit.Paul Phillips2012-02-291-4/+4
| | | | | | | Removed all the trailing whitespace to make eugene happier. Will try to keep it that way by protecting at the merge level. Left the tabs in place because they can't be uniformly changed to spaces, some are 2, some are 4, some are 8, whee.
* Specialization action.Paul Phillips2012-02-141-8/+6
| | | | | | | | | | | | | | | | | | | | | The crickets at http://www.scala-lang.org/node/11901 were in unanimous agreement that I should proceed as suggested. - No arguments to @specialize gets you 10/10, not 9/10 - Fixed bugs in AnyRef specialization revealed by trying to use it - Specialized Function1 on AnyRef. - Changed AnyRef specialization to use OBJECT_TAG, not TVAR_TAG. - Deprecated SpecializableCompanion in favor of Specializable, which has the virtue of being public so it can be referenced from outside the library. - Cooked up mechanism to group specializable types so we don't have to repeat ourselves quite so much, and create a few groups for illustrative purposes. I'm not too serious about those names but I used up all my name-thinking-up brain for the day. - Updated genprod and friends since I had to regenerate Function1. - Put tests for a bunch of remaining specialization bugs in pending. Closes SI-4740, SI-4770, SI-5267.
* Explain Function1 vs PartialFunctionDaniel C. Sobral2012-01-131-1/+9
| | | | | | | | | | Add an explanation in PartialFunction as to how it differs from Function1, with examples of what it can do that Function1 cannot. Make it explicit that calling apply may throw exceptions in both of them, even in the case where isDefinedAt returns true. Closes SI-5370.
* Added some implicitNotFound annotations to comm...Paul Phillips2011-03-281-0/+1
| | | | | | | Added some implicitNotFound annotations to commonly used classes, and some documentation to Manifest. (Said documentation is invisible for the moment due to #4404.) No review.
* Moved unlift to the Function companion object, ...Paul Phillips2011-02-201-32/+20
| | | | | | | | | | | | | | Moved unlift to the Function companion object, which might have been better in the first place. Had to make a minor change to genprod, and then I couldn't escape that unscathed. Finished the not very complete undertaking I found there to update the scaladoc. Lots of little changes to the generated text and code. I changed genprod to only put a unique stamp on Function0 so we can stop having a 100 file diff everytime an i is dotted somewhere. Closes #3825, no review.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Documentation being generated by genprod was pr...Paul Phillips2010-10-161-15/+12
| | | | | | | Documentation being generated by genprod was pretty busted both in terms of formatting and correctness. Spruced it up. Eliminated some of the more distracting HTML entities in compiler source. No review.
* An overhaul of the collection-oriented methods ...Paul Phillips2010-10-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An overhaul of the collection-oriented methods in Tuple2/Tuple3 (which still need to be taken all the way to Tuple5.) * Zip semantics: zip and zipped now properly terminate when any collection runs out of elements, even if others are infinite. In addition, short circuiting methods (exists and forall) will terminate if the condition is met, even in the presence of infinity. Example: scala> val ys = Stream from 1 ys: scala.collection.immutable.Stream[Int] = Stream(1, ?) scala> (ys, ys).zipped forall ((x, y) => x+y < 100) res0: Boolean = false scala> (ys, ys).zipped exists ((x, y) => x+y > 100) res1: Boolean = true * There are implicits converting Zipped2/3 to Traversable to expose all the methods which aren't defined in an arity-specific way in the tuple classes. I have mixed feelings about putting these in Predef; but if there is another way to make them visible by default I wasn't able to find it. Example putting said implicit to use: scala> (ys, ys, ys).zipped find { case (x, y, z) => x+y+z > 1000 } res0: Option[(Int, Int, Int)] = Some((334,334,334)) Already reviewed by moors, so no review.
* Proposed implementation of 'unlift' on Function...Paul Phillips2010-09-091-1/+16
| | | | | | | Proposed implementation of 'unlift' on Function1, the inverse function of PartialFunction#lift. Review by rytz and other interested parties. References #3825, but not closing until this is further considered.
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* Regenerated FunctionN, AbstractFunctionN, etc.Iulian Dragos2010-04-291-2/+2
| | | | | | | to properly specialize on primitive types (scala.Int, instead of scala.runtime.Int). Now closures should be indeed specialized. No review.
* Regenerated tuples, products and (Abstract)Func...Iulian Dragos2010-04-121-2/+3
| | | | | | | | Regenerated tuples, products and (Abstract)Functions. We needed to have separate files for AbstractFunctionN because the compiler may need their symbol even before their sourcefile is parsed. In such cases it relies on finding a source file with the right name.
* Changed the syntax of the specialized annotation:Iulian Dragos2010-04-091-1/+1
| | | | | | | | | instead of a flaky string, it now takes a repeated parameter list of primitive types: @specialized("Int, Double") becomes @specialized(Int, Double). No review.
* Adjectified some parts of speech as discussed o...Paul Phillips2010-01-181-1/+1
| | | | | | | Adjectified some parts of speech as discussed on the mailing list. The methods to call on FunctionN are "curried" and "tupled" with "curry" deprecated and "tuple" gone. Closes #2907. Review by community.
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* Built out genprod to create a tuple method for ...Paul Phillips2009-12-021-1/+1
| | | | | | Built out genprod to create a tuple method for reach function alongside its curry method. Generated new FunctionNs.
* Reverted r19466, as the decision is now thatAntonio Cunei2009-11-091-6/+0
| | | | | isDefinedAt should /not/ be in Function1
* Adds isDefinedAt to Function1. As a consequence,Antonio Cunei2009-11-091-0/+6
| | | | | | | | code that mixes in PartialFunction now have to define isDefinedAt as override. Fixes #2225.
* Newly generated Tuple/Product/Function classes ...Paul Phillips2009-06-171-7/+7
| | | | | | Newly generated Tuple/Product/Function classes from new genprod, plus a couple minor tweaks to genprod to keep tests happy.
* Updated copyright notices to 2009Antonio Cunei2009-01-091-1/+1
|
* Modified the implementation of curry so that forGeoffrey Washburn2008-04-231-2/+2
| | | | | | | | | FunctionN, where N > 4, many fewer classes are created statically at the expense of creating more objects dynamically (which seems reasonable given how common such functions are likely to be). This also allows for curry in FunctionN for N > 8 without running into the filename length restriction.
* Really fixed curry this time.Geoffrey Washburn2008-04-221-1/+1
|
* No curry for you! (If you are FunctionN, for N ...Geoffrey Washburn2008-04-221-1/+1
| | | | | No curry for you! (If you are FunctionN, for N < 2 and N > 16)
* Corrected uncurry to be called curry.Geoffrey Washburn2008-04-221-1/+1
| | | | | Generalized curry to FunctionN for N >= 2
* Improvements to genprodGeoffrey Washburn2008-04-161-6/+6
| | | | | Added uncurry to Function2, swap to Tuple2.
* updated element/arity to productElement/product...michelou2007-04-191-2/+2
| | | | | updated element/arity to productElement/productArity
* renamed arity=>productArity,element=>productEle...Burak Emir2007-04-121-1/+1
| | | | | renamed arity=>productArity,element=>productElement
* finalized the TupleN ProductN change (last dist...Burak Emir2007-01-031-1/+1
| | | | | | | finalized the TupleN ProductN change (last dist: no automatic addition of ProductN, this dist: manual addition of ProductN to TupleN by means of modified genprod tool)
* (no commit message)Burak Emir2007-01-031-1/+1
|
* genBurak Emir2007-01-031-1/+1
|
* * TupleN extends ProductN, again (genprod updated)Burak Emir2007-01-021-1/+1
| | | | | | | | | | * better comments and parameter names in scala.xml.MetaData typechecker * now handles special cases (n=0, n=1) for unapply correctly * * even if one returns a Option[Product1[T]] * typechecker now handles unapply return types correctly * * e.g. when returning Option[{A,B}] instead of Option[Product2[A,B]]
* more tuplesBurak Emir2006-12-121-1/+1
|
* updated genprod.scala (Function1)michelou2006-12-081-18/+22
|
* implemented infix type operatorsMartin Odersky2006-12-081-0/+7
|
* fixed problems with refinements.Martin Odersky2006-11-291-2/+1
| | | | | added missing decode in error diagnostic
* more fun with positions, and updated docBurak Emir2006-11-281-1/+1
|
* product.element index starts with 0Burak Emir2006-11-281-1/+1
|
* more products, plus some static optimization in...Burak Emir2006-11-271-6/+9
| | | | | more products, plus some static optimization in pattern matcher
* added code example to Scala comment in scala/Fu...michelou2006-09-271-1/+15
| | | | | added code example to Scala comment in scala/Function<i>.scala
* (no commit message)Martin Odersky2006-07-241-0/+2
|
* removed semicolonsmichelou2006-05-291-3/+3
|
* performed some renamings in the compiler & libraryMartin Odersky2006-03-091-1/+1
| | | | | | | All -> Bottom AllRef -> Null mixin class -> trait
* Use 'mixin class' instead of 'trait'mihaylov2006-03-031-1/+1
|