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
exportfunctionreduce<A,B>(f: (acc: A,val: B)=>A,seed: A,arr: B[]): A
The “prelude”-reduce doesn’t allow ReadonlyArrays as lists, for example.
In addition, it seems incorrect to call the first parameter of the Reducer for seed. To my knowledge, it is common to call it accumulator or just acc. It is, however, correct to call it seed in the reduce.
The text was updated successfully, but these errors were encountered:
The prelude export is not List<A> but B[]. Thus, you can not use a ReadonlyArray nor ArrayLike if you operate with the prelude version. In addition, prelude’s reduce specifies the first template type A as the seed and return type, whereas the list version has the template types reversed.
The type definition for
reduce()
in @typed/prelude does not match the type definition forreduce()
in @typed/list.@typed/list:
@typed/prelude:
The “prelude”-reduce doesn’t allow
ReadonlyArray
s as lists, for example.In addition, it seems incorrect to call the first parameter of the
Reducer
forseed
. To my knowledge, it is common to call itaccumulator
or justacc
. It is, however, correct to call itseed
in thereduce
.The text was updated successfully, but these errors were encountered: