From 90c104beade5892ad1417fe107b66036f9e7380a Mon Sep 17 00:00:00 2001 From: Maksym Kurets Date: Wed, 30 Sep 2026 23:40:23 +0200 Subject: [PATCH] Fix foldr direction and arguments order --- u2/list_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/u2/list_ops.py b/u2/list_ops.py index 5f19ccb..fe1b916 100644 --- a/u2/list_ops.py +++ b/u2/list_ops.py @@ -40,7 +40,7 @@ def foldl(function, list, initial): def foldr(function, list, initial): acc = initial for gns in list[::-1]: - acc = function(gns, acc) + acc = function(acc, gns) return acc def reverse(list):