New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scanRight returns result in the wrong order #4161
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4161?orig=1 |
@lindydonna said: |
Jim Balter (jibal) said:
The Haskell documentation for [http://www.haskell.org/ghc/docs/7.0.1/html/libraries/base-4.3.0.0/Prelude.html#v:scanr scanr] says head (scanr f z xs) == foldr f z xs. It seems clear that scanRight should do the same, that it is coded incorrectly, and that the inadequate Scala documentation -- and documentation standards and documentation culture -- contributed to this error. Those are process errors, and that this is viewed as an enhancement rather than a defect suggests another process error. |
@lindydonna said: |
@lindydonna said: |
=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===
=== What is the expected behavior? ===
As in Haskell:
=== What do you see instead? ===
=== Additional information ===
scanRight
is implemented atTraversableLike
and also atTraversableViewLike
,TraversableProxyLike
andParSeqViewLike
, though all of these just referenceTraversableLike
.No other part of Scala's source make use of it, but it has been available since Scala 2.8.0, and merits a migration warning.
The present documentation is not very clear about the direction of the result, though I personally think it describes how it is presently working, not how it should (IMO) work.
Unfortunately, neither
reduceRight
norfoldRight
serve as a parameter, since neither produce collections as result.=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: