Closed scabug closed 13 years ago
Imported From: https://issues.scala-lang.org/browse/SI-4021?orig=1 Reporter: Dave Copeland (davetron5000) Attachments:
Dave Copeland (davetron5000) said: Applies against 23561 to update docs in Product and code in genprod to do same
Dave Copeland (davetron5000) said: Applies against 23561 that is the results of running genprod mod from previous patch
Dave Copeland (davetron5000) said:
Examples of the wording that this version of genprod
products:
== FunctionXX
==
def curried : (T1) ⇒ (T2) ⇒ (T3) ⇒ (T4) ⇒ R Returns a curried version of this function.
returns a function f such that f(x1)(x2)(x3)(x4) == apply(x1, x2, x3, x4)
def tupled : ((T1, T2, T3, T4)) ⇒ R Returns a version of this function that takes a Tuple4 as its argument instead of 4 arguments.
returns a function f such that f((x1, x2, x3, x4)) == f(Tuple4(x1, x2, x3, x4)) == apply(x1, x2, x3, x4)
def andThen [A] (g: (R) ⇒ A) : (T1) ⇒ A Returns a function taking one argument that applies g to this function applied to the argument.
returns a function f such that f(x) == g(apply(x))
== ProductXX
==
def _2 : T2 Returns a projection of element 2 of this product.
returns a projection of element 2
def productElement (n: Int) : Any Returns the n-th projection of this product if 0 < n <= productArity, otherwise throws an IndexOutOfBoundsException.
n number of the projection to be returned
returns same as ._(n+1), for example productElement(1) is the same as ._1.
@dragos said: Thank you for your patch. Please make sure you sign and send us the Scala Contributor Agreement, if you haven't done it already:
http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf
@dragos said: (In r23577) Applied patch from davetron5000, improving documentation on ProductN and FunctionN traits. Closes #4021.
Dave Copeland (davetron5000) said: Replying to [comment:4 dragos]:
Thank you for your patch. Please make sure you sign and send us the Scala Contributor Agreement, if you haven't done it already:
http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf
It should be on file as David Copeland. Let me know if you don't have it.
Scaladoc of
Product
,ProductXX
andFunctionXX
could be better; docs are inconsistent and impreciseTwo patches included (both apply against [r23561]):
ProductAndGenProd.diff.gz
- this has some changes toProduct.scala
andgenprod.scala
. Doc improvements include consistency, correctness, and completnessProductFunctionGenerated.diff.gz
- this is the results of runninggenprod
on the codebase; I couldn't find a way to do this from the ant file, but things seem to work more or less.