You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2015/11/12 07:47:11 UTC
[jira] [Created] (SPARK-11687) Mixed usage of fold and foldLeft,
reduce and reduceLeft and reduceOption and reduceLeftOption
Hyukjin Kwon created SPARK-11687:
------------------------------------
Summary: Mixed usage of fold and foldLeft, reduce and reduceLeft and reduceOption and reduceLeftOption
Key: SPARK-11687
URL: https://issues.apache.org/jira/browse/SPARK-11687
Project: Spark
Issue Type: Improvement
Reporter: Hyukjin Kwon
Priority: Trivial
As can be seen here https://github.com/scala/scala/blob/2.12.x/src/library/scala/collection/TraversableOnce.scala, fold, reduce and reduceOption came out from scala 2.9.x. In addition, all the implementations of fold, reduce and reduceOption call actually foldLeft, reduceLeft and reduceLeftOption directly without any additional codes.
For developers who is not really used to scala, the mixed usage of them might leave a question. Even some usages can be found where they work identically the same things.
This is just a little nit but I think it would be better to use only xxxLeft for readability.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org