Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Breaking changes:
New features:

Bugfixes:
- Fixed `Semigroup.append` broken for `Array` (#4 by @Renegatto)

Other improvements:

Expand Down
10 changes: 9 additions & 1 deletion src/Data/Semigroup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}