mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Implement List.map4
This commit is contained in:
parent
b29a029a33
commit
f9ed060e49
16 changed files with 419 additions and 16 deletions
|
@ -25,6 +25,7 @@ interface List
|
|||
map,
|
||||
map2,
|
||||
map3,
|
||||
map4,
|
||||
mapWithIndex,
|
||||
mapOrDrop,
|
||||
mapJoin,
|
||||
|
@ -269,6 +270,11 @@ map2 : List a, List b, (a, b -> c) -> List c
|
|||
## Repeat until a list runs out of elements.
|
||||
map3 : List a, List b, List c, (a, b, c -> d) -> List d
|
||||
|
||||
## Run a transformation function on the first element of each list,
|
||||
## and use that as the first element in the returned list.
|
||||
## Repeat until a list runs out of elements.
|
||||
map4 : List a, List b, List c, List d, (a, b, c, d -> e) -> List e
|
||||
|
||||
## This works like [List.map], except it also passes the index
|
||||
## of the element to the conversion function.
|
||||
mapWithIndex : List before, (before, Nat -> after) -> List after
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue