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
According to Functional Bonding · Cheddar Documentation, f & a is equivalent to *args -> f(*(args + [a])), meaning that (+)&1 is equivalent to a->(+)(a,1), which is equivalent to a->a+1.
This is desired behavior. .map produces 3 args: (item, index, array) so it's really calling (+)(item, index, array, 1). You can use => e.g.: [1,2,3]=>((+)&1) or (+:1)
Desired Behavior
According to Functional Bonding · Cheddar Documentation,
f & a
is equivalent to*args -> f(*(args + [a]))
, meaning that(+)&1
is equivalent toa->(+)(a,1)
, which is equivalent toa->a+1
.How to Reproduce
print ([1,2,3].map((+)&1))
is expected to produce[2,3,4]
, but produced[1,3,5]
instead.The text was updated successfully, but these errors were encountered: