You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @donnut, thanks for doing these definitions. I have a question that might have a simple answer. I can't figure out how to make a legal use of R.reduce:
/// <reference path="typings/ramda/ramda.d.ts"/>
import R = require('ramda');
var add = (item: number, sum: number): number => sum + item
var avg = (list: Array<number>): any => {
var sum: number = R.reduce(add, list);
return sum / list.length;
}
error TS2453: The type argument for type parameter 'TResult' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'number[]'.
The text was updated successfully, but these errors were encountered:
Hey @donnut, thanks for doing these definitions. I have a question that might have a simple answer. I can't figure out how to make a legal use of
R.reduce
:The text was updated successfully, but these errors were encountered: