mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Rename an argument
This commit is contained in:
parent
3991bd31d6
commit
1c2047fbeb
1 changed files with 2 additions and 2 deletions
|
@ -781,14 +781,14 @@ joinMap = \list, mapper ->
|
|||
## Returns the first element of the list satisfying a predicate function.
|
||||
## If no satisfying element is found, an `Err NotFound` is returned.
|
||||
findFirst : List elem, (elem -> Bool) -> Result elem [NotFound]*
|
||||
findFirst = \array, pred ->
|
||||
findFirst = \list, pred ->
|
||||
callback = \_, elem ->
|
||||
if pred elem then
|
||||
Break elem
|
||||
else
|
||||
Continue {}
|
||||
|
||||
when List.iterate array {} callback is
|
||||
when List.iterate list {} callback is
|
||||
Continue {} -> Err NotFound
|
||||
Break found -> Ok found
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue