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
Callbacks for foldl or foldr have different argument signature for objects and arrays. For example, foldl(fn, 0, [1, 2, 3]) will invoke the callback with 0, 1, where 0 is the initial value and memo is 1. Doing the same with an object { 1:1, 2:2, 2:3 } will send 0, { key: "1", value: 1 }.
This gets awkward when your application might invoke the fold on an array or object because the callback has to check the type of the original object to know what call signature to expect.
I propose that we change the array signature to match that of the object. It'll require changing all places where the folds are used. Considering that we're still pre 1.0, we can make these changes.
The text was updated successfully, but these errors were encountered:
The callbacks for Functor are very similar. One difference I see is that array functor eager, unlike object functor. What specifically are you referring to?
Callbacks for
foldl
orfoldr
have different argument signature for objects and arrays. For example,foldl(fn, 0, [1, 2, 3])
will invoke the callback with0, 1
, where 0 is the initial value and memo is1
. Doing the same with an object{ 1:1, 2:2, 2:3 }
will send0, { key: "1", value: 1 }
.This gets awkward when your application might invoke the fold on an array or object because the callback has to check the type of the original object to know what call signature to expect.
I propose that we change the array signature to match that of the object. It'll require changing all places where the folds are used. Considering that we're still pre 1.0, we can make these changes.
The text was updated successfully, but these errors were encountered: