mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-09-11 12:15:24 +03:00
Merge pull request #68 from jfmengels/list-concat-map-replacement
Add List concatMap replacement
This commit is contained in:
commit
8ce60a3357
18
src/replacements/list/$elm$core$List$concatMap.js
Normal file
18
src/replacements/list/$elm$core$List$concatMap.js
Normal file
@ -0,0 +1,18 @@
|
||||
var $elm$core$List$concatMap = F2(function (f, lists) {
|
||||
if (!lists.b) {
|
||||
return _List_Nil;
|
||||
}
|
||||
var tmp = _List_Cons(undefined, _List_Nil);
|
||||
var end = tmp;
|
||||
for (; lists.b.b; lists = lists.b) {
|
||||
var xs = f(lists.a);
|
||||
for (; xs.b; xs = xs.b) {
|
||||
var next = _List_Cons(xs.a, _List_Nil);
|
||||
end.b = next;
|
||||
end = next;
|
||||
}
|
||||
}
|
||||
end.b = f(lists.a);
|
||||
|
||||
return tmp.b;
|
||||
});
|
Loading…
Reference in New Issue
Block a user