* Function concatMap as in Haskell.
svn path=/nixpkgs/trunk/; revision=10501
This commit is contained in:
parent
c583b8389b
commit
937f8663ac
@ -52,6 +52,10 @@ rec {
|
|||||||
fold (x: y: x + y) "";
|
fold (x: y: x + y) "";
|
||||||
|
|
||||||
|
|
||||||
|
# Map and concatenate the result.
|
||||||
|
concatMap = f: list: concatLists (map f list);
|
||||||
|
|
||||||
|
|
||||||
# Place an element between each element of a list, e.g.,
|
# Place an element between each element of a list, e.g.,
|
||||||
# `intersperse "," ["a" "b" "c"]' returns ["a" "," "b" "," "c"].
|
# `intersperse "," ["a" "b" "c"]' returns ["a" "," "b" "," "c"].
|
||||||
intersperse = separator: list:
|
intersperse = separator: list:
|
||||||
|
Loading…
Reference in New Issue
Block a user