mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
roc format examples
This commit is contained in:
parent
7ed35eca50
commit
7908e8c176
32 changed files with 231 additions and 232 deletions
|
@ -14,8 +14,8 @@ quicksortHelp = \list, low, high ->
|
|||
when partition low high list is
|
||||
Pair partitionIndex partitioned ->
|
||||
partitioned
|
||||
|> quicksortHelp low (partitionIndex - 1)
|
||||
|> quicksortHelp (partitionIndex + 1) high
|
||||
|> quicksortHelp low (partitionIndex - 1)
|
||||
|> quicksortHelp (partitionIndex + 1) high
|
||||
else
|
||||
list
|
||||
|
||||
|
@ -50,8 +50,8 @@ swap = \i, j, list ->
|
|||
when Pair (List.get list i) (List.get list j) is
|
||||
Pair (Ok atI) (Ok atJ) ->
|
||||
list
|
||||
|> List.set i atJ
|
||||
|> List.set j atI
|
||||
|> List.set i atJ
|
||||
|> List.set j atI
|
||||
|
||||
_ ->
|
||||
# to prevent a decrement on list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue