From e32a95d9c74653c61346e83076f92bc24a648d63 Mon Sep 17 00:00:00 2001 From: Renegatto <46404781+Renegatto@users.noreply.github.com> Date: Sat, 25 Oct 2025 02:43:44 +0300 Subject: [PATCH 1/2] Fix Semigroup.lua/concatArray misusing table.concat for arrays concatenation concatArray: ([String], String, Int, Int) -> String does not concatenate arrays, it is rather some equivalent of Array.prototype.join in JS. --- src/Data/Semigroup.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Data/Semigroup.lua b/src/Data/Semigroup.lua index 22165467..6949b09a 100644 --- a/src/Data/Semigroup.lua +++ b/src/Data/Semigroup.lua @@ -4,7 +4,15 @@ return { return function(ys) if #xs == 0 then return ys end if #ys == 0 then return xs end - return table.concat(xs, ys) + local result = {} + for index, value in ipairs(xs) do + result[index] = value + end + local offset = #result + for index, value in ipairs(ys) do + result[index + offset] = value + end + return result end end) } From 508b646a33f1105c5b18d46b0dedd5e9b1314ba5 Mon Sep 17 00:00:00 2001 From: Renegatto <46404781+Renegatto@users.noreply.github.com> Date: Sat, 25 Oct 2025 02:50:03 +0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e5af83..27b3952a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Breaking changes: New features: Bugfixes: +- Fixed `Semigroup.append` broken for `Array` (#4 by @Renegatto) Other improvements: