mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
fix naming to be relevant to example
This commit is contained in:
parent
fea1cfa57d
commit
dccb1be5b5
1 changed files with 3 additions and 3 deletions
|
@ -234,15 +234,15 @@ walk = \@Dict { data }, initialState, transform ->
|
|||
## |> Dict.insert "Bob" 18
|
||||
## |> Dict.insert "Charlie" 19
|
||||
##
|
||||
## over18 = \_, _, age ->
|
||||
## isAdult = \_, _, age ->
|
||||
## if age >= 18 then
|
||||
## Break Bool.true
|
||||
## else
|
||||
## Continue Bool.false
|
||||
##
|
||||
## someoneIsOver18 = Dict.walkUntil people Bool.false over18
|
||||
## someoneIsAnAdult = Dict.walkUntil people Bool.false isAdult
|
||||
##
|
||||
## expect someoneIsOver18 == Bool.true
|
||||
## expect someoneIsAnAdult == Bool.true
|
||||
## ```
|
||||
walkUntil : Dict k v, state, (state, k, v -> [Continue state, Break state]) -> state | k has Hash & Eq
|
||||
walkUntil = \@Dict { data }, initialState, transform ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue