From 6f8d1698fed59b90b39046fc3e5689f5a12d086c Mon Sep 17 00:00:00 2001 From: KtorZ Date: Thu, 29 Dec 2022 12:13:29 +0100 Subject: [PATCH] Add missing function 'concat' in acceptance test 034. --- examples/acceptance_tests/034/lib/tests.ak | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/acceptance_tests/034/lib/tests.ak b/examples/acceptance_tests/034/lib/tests.ak index a215135f..110d7f90 100644 --- a/examples/acceptance_tests/034/lib/tests.ak +++ b/examples/acceptance_tests/034/lib/tests.ak @@ -5,6 +5,10 @@ pub fn foldr(self: List, with: fn(a, b) -> b, zero: b) -> b { } } +pub fn concat(left: List, right: List) -> List { + foldr(left, fn(x, xs) { [x, ..xs] }, right) +} + pub fn flat_map(self: List, with: fn(a) -> List) -> List { foldr(self, fn(x, xs) { concat(with(x), xs) }, []) }