mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
fix parser problem in Dict.roc
This commit is contained in:
parent
4418a99c89
commit
169e34b583
1 changed files with 5 additions and 6 deletions
|
@ -8,15 +8,14 @@ isEmpty : Dict * * -> Bool
|
||||||
|
|
||||||
## Convert each key and value in the #Dict to something new, by calling a conversion
|
## Convert each key and value in the #Dict to something new, by calling a conversion
|
||||||
## function on each of them. Then return a new #Map of the converted keys and values.
|
## function on each of them. Then return a new #Map of the converted keys and values.
|
||||||
##
|
##
|
||||||
## >>> Dict.map {{ 3.14 => "pi", 1.0 => "one" }} \{ key, value } -> { key:
|
## >>> Dict.map {{ 3.14 => "pi", 1.0 => "one" }} \{ key, value } -> { key:
|
||||||
##
|
##
|
||||||
## >>> Dict.map {[ "", "a", "bc" ]} Str.isEmpty
|
## >>> Dict.map {[ "", "a", "bc" ]} Str.isEmpty
|
||||||
##
|
##
|
||||||
## `map` functions like this are common in Roc, and they all work similarly.
|
## `map` functions like this are common in Roc, and they all work similarly.
|
||||||
## See for example #Result.map, #List.map, and #Set.map.
|
## See for example #Result.map, #List.map, and #Set.map.
|
||||||
map :
|
map :
|
||||||
Dict beforeKey beforeValue,
|
Dict beforeKey beforeValue,
|
||||||
(\{ key: beforeKey, value: beforeValue } ->
|
({ key: beforeKey, value: beforeValue } -> { key: afterKey, value: afterValue })
|
||||||
{ key: afterKey, value: afterValue }
|
-> Dict afterKey afterValue
|
||||||
) -> Dict afterKey afterValue
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue