Re:Unifying fold left and fold right in Prolog
by rraval on Friday August 26, 2022 @01:59PM
(#32610723)
Hah, you beat me to this by a minute. I guess I'm not the only one that looks back on this paper with fondness.
[ Parent
| on HN ]
Re:Unifying fold left and fold right in Prolog
by 082349872349872 on Friday August 26, 2022 @02:15PM
(#32610892)
After you have a right fold and a left fold (both of which fold elemental values one by one into a bulk accumulation), might as well pretend we've got access to a bit more working memory than in the days of Unit Record Equipment, and write an associative "bottom up" fold, that first combines pairs of elemental values, then combines pairs of those combinations, etc., terminating with a single bulk result.