mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Run roc format
This commit is contained in:
parent
a9196a9abb
commit
00839e12b5
2 changed files with 28 additions and 19 deletions
|
@ -1491,42 +1491,48 @@ expect
|
|||
|> Bool.isEq Bool.true
|
||||
|
||||
expect
|
||||
d1 = Dict.empty {}
|
||||
d1 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert "Alice" 17
|
||||
|> Dict.insert "Bob" 18
|
||||
|> Dict.insert "Charlie" 19
|
||||
|> Dict.keepIf \(_k, v) -> v >= 18
|
||||
|
||||
d2 = Dict.empty {}
|
||||
d2 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert "Bob" 18
|
||||
|> Dict.insert "Charlie" 19
|
||||
|
||||
d1 == d2
|
||||
|
||||
expect
|
||||
d1 = Dict.empty {}
|
||||
d1 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert "Alice" 17
|
||||
|> Dict.insert "Bob" 18
|
||||
|> Dict.insert "Charlie" 19
|
||||
|> Dict.keepIf \(k, _v) -> Str.endsWith k "e"
|
||||
|
||||
d2 = Dict.empty {}
|
||||
d2 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert "Alice" 17
|
||||
|> Dict.insert "Charlie" 19
|
||||
|
||||
d1 == d2
|
||||
|
||||
expect
|
||||
keysToDelete = [1,2]
|
||||
d1 = Dict.empty {}
|
||||
keysToDelete = [1, 2]
|
||||
d1 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert 0 0
|
||||
|> Dict.insert 1 1
|
||||
|> Dict.insert 2 2
|
||||
|> Dict.insert 3 3
|
||||
|> Dict.insert 4 4
|
||||
|> Dict.keepIf (\(k,_v) -> List.contains keysToDelete k |> Bool.not)
|
||||
|> Dict.keepIf (\(k, _v) -> List.contains keysToDelete k |> Bool.not)
|
||||
|
||||
d2 = Dict.empty {}
|
||||
d2 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert 0 0
|
||||
|> Dict.insert 3 3
|
||||
|> Dict.insert 4 4
|
||||
|
@ -1534,16 +1540,18 @@ expect
|
|||
d1 == d2
|
||||
|
||||
expect
|
||||
keysToDelete = [2,4]
|
||||
d1 = Dict.empty {}
|
||||
keysToDelete = [2, 4]
|
||||
d1 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert 0 0
|
||||
|> Dict.insert 1 1
|
||||
|> Dict.insert 2 2
|
||||
|> Dict.insert 3 3
|
||||
|> Dict.insert 4 4
|
||||
|> Dict.keepIf (\(k,_v) -> List.contains keysToDelete k |> Bool.not)
|
||||
|> Dict.keepIf (\(k, _v) -> List.contains keysToDelete k |> Bool.not)
|
||||
|
||||
d2 = Dict.empty {}
|
||||
d2 =
|
||||
Dict.empty {}
|
||||
|> Dict.insert 0 0
|
||||
|> Dict.insert 1 1
|
||||
|> Dict.insert 3 3
|
||||
|
|
|
@ -346,7 +346,6 @@ walkUntil : Set k, state, (state, k -> [Continue state, Break state]) -> state w
|
|||
walkUntil = \@Set dict, state, step ->
|
||||
Dict.walkUntil dict state (\s, k, _ -> step s k)
|
||||
|
||||
|
||||
## Run the given function on each element in the `Set`, and return
|
||||
## a `Set` with just the elements for which the function returned `Bool.true`.
|
||||
## ```
|
||||
|
@ -356,7 +355,7 @@ walkUntil = \@Set dict, state, step ->
|
|||
## ```
|
||||
keepIf : Set k, (k -> Bool) -> Set k
|
||||
keepIf = \@Set dict, predicate ->
|
||||
@Set (Dict.keepIf dict (\(k,_v) -> predicate k))
|
||||
@Set (Dict.keepIf dict (\(k, _v) -> predicate k))
|
||||
|
||||
## Run the given function on each element in the `Set`, and return
|
||||
## a `Set` with just the elements for which the function returned `Bool.false`.
|
||||
|
@ -367,7 +366,7 @@ keepIf = \@Set dict, predicate ->
|
|||
## ```
|
||||
dropIf : Set k, (k -> Bool) -> Set k
|
||||
dropIf = \@Set dict, predicate ->
|
||||
@Set (Dict.dropIf dict (\(k,_v) -> predicate k))
|
||||
@Set (Dict.dropIf dict (\(k, _v) -> predicate k))
|
||||
|
||||
expect
|
||||
first =
|
||||
|
@ -469,10 +468,12 @@ expect
|
|||
|
||||
wrapperOne == wrapperTwo
|
||||
|
||||
expect Set.fromList [1,2,3,4,5]
|
||||
expect
|
||||
Set.fromList [1, 2, 3, 4, 5]
|
||||
|> Set.keepIf \k -> k >= 3
|
||||
|> Bool.isEq (Set.fromList [3,4,5])
|
||||
|> Bool.isEq (Set.fromList [3, 4, 5])
|
||||
|
||||
expect Set.fromList [1,2,3,4,5]
|
||||
expect
|
||||
Set.fromList [1, 2, 3, 4, 5]
|
||||
|> Set.dropIf \k -> k >= 3
|
||||
|> Bool.isEq (Set.fromList [1,2])
|
||||
|> Bool.isEq (Set.fromList [1, 2])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue