Merge pull request #74 from jfmengels/list-take-replacement

Add replacement for List.take
This commit is contained in:
Matthew Griffith 2022-02-06 11:50:20 -05:00 committed by GitHub
commit 895aecc1f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,10 @@
var $elm$core$List$take = F2(function(n, xs) {
var tmp = _List_Cons(undefined, _List_Nil);
var end = tmp;
for (var i = 0; i < n && xs.b; xs = xs.b, i++) {
var next = _List_Cons(xs.a, _List_Nil);
end.b = next;
end = next;
}
return tmp.b;
});