Reduce is a left fold, but ReduceRight isn't a right fold (andrewray.me) 2 points by Akronymus 3y ago ↗ HN
[–] Akronymus 3y ago ↗ Posting this here, because it tripped me up quite heavily today, with me expecting the wrong behaviour.
[–] josephcsible 3y ago ↗ That is still a right fold! Your lambda just needs to accept the arguments as (elem, acc) instead of (acc, elem).
2 comments
[ 3.8 ms ] story [ 96.0 ms ] thread