Skip to content

Commit 689e736

Browse files
committed
Array semigroup optimisation
1 parent 43b8641 commit 689e736

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Data/Semigroup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ exports.concatString = function (s1) {
1010

1111
exports.concatArray = function (xs) {
1212
return function (ys) {
13+
if (xs.length === 0) return ys;
14+
if (ys.length === 0) return xs;
1315
return xs.concat(ys);
1416
};
1517
};

0 commit comments

Comments
 (0)