[ramda]: Correct order of reducing-fn params in reduceRight (#18798)

The reducing function in Ramda's reduceRight has signature
(elem: T, acc: TResult) => TResult,
as per https://github.com/ramda/ramda/blob/v0.24.0/src/reduceRight.js.

The order of the parameters was switched at
https://github.com/ramda/ramda/commit/68d1dc19fb035b0fcafcc1857331f9d00986470f
This commit is contained in:
Cort Spellman
2017-09-24 15:39:09 +09:00
committed by Masahiro Wakame
parent 040a0eb7c5
commit 1066f6fb82
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -1525,9 +1525,9 @@ declare namespace R {
* function and passing it an accumulator value and the current value from the array, and
* then passing the result to the next call.
*/
reduceRight<T, TResult>(fn: (acc: TResult, elem: T) => TResult, acc: TResult, list: T[]): TResult;
reduceRight<T, TResult>(fn: (acc: TResult, elem: T) => TResult): (acc: TResult, list: T[]) => TResult;
reduceRight<T, TResult>(fn: (acc: TResult, elem: T) => TResult, acc: TResult): (list: T[]) => TResult;
reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult, acc: TResult, list: T[]): TResult;
reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult): (acc: TResult, list: T[]) => TResult;
reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult, acc: TResult): (list: T[]) => TResult;
/**
* Similar to `filter`, except that it keeps only values for which the given predicate
+2 -2
View File
@@ -328,7 +328,7 @@ R.times(i, 5);
(() => {
const pairs = [["a", 1], ["b", 2], ["c", 3]];
function flattenPairs(acc: [string, number], pair: [string, number]) {
function flattenPairs(pair: [string, number], acc: Array<string|number>): Array<string|number> {
return acc.concat(pair);
}
@@ -911,7 +911,7 @@ type Pair = KeyValuePair<string, number>;
() => {
const pairs: Pair[] = [["a", 1], ["b", 2], ["c", 3]];
function flattenPairs(acc: Pair[], pair: Pair): Pair[] {
function flattenPairs(pair: Pair, acc: Array<string|number>): Array<string|number> {
return acc.concat(pair);
}