Skip to content

Commit

Permalink
Merge pull request #94 from purescript/array-semigroup-optimisation
Browse files Browse the repository at this point in the history
Array semigroup optimisation
  • Loading branch information
garyb authored Sep 26, 2016
2 parents 178e71d + 689e736 commit 4b9fdde
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Data/Semigroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ exports.concatString = function (s1) {

exports.concatArray = function (xs) {
return function (ys) {
if (xs.length === 0) return ys;
if (ys.length === 0) return xs;
return xs.concat(ys);
};
};

0 comments on commit 4b9fdde

Please sign in to comment.