mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
improve benchmark error handling, bugfixes
This commit is contained in:
parent
65ebeab303
commit
8861c9394a
7 changed files with 86 additions and 45 deletions
|
@ -5,9 +5,10 @@ app "quicksortapp"
|
|||
|
||||
main : Task.Task {} []
|
||||
main =
|
||||
Task.after
|
||||
Task.getInt
|
||||
\n ->
|
||||
inputResult <- Task.attempt Task.getInt
|
||||
|
||||
when inputResult is
|
||||
Ok n ->
|
||||
unsortedList =
|
||||
if n == 0 then
|
||||
# small unsorted list of 20 elements (0-9)
|
||||
|
@ -20,6 +21,10 @@ main =
|
|||
|> Quicksort.show
|
||||
|> Task.putLine
|
||||
|
||||
Err GetIntError ->
|
||||
Task.putLine "Error: Failed to get Integer from stdin."
|
||||
|
||||
|
||||
sort : List I64 -> List I64
|
||||
sort = \list ->
|
||||
Quicksort.sortWith list (\x, y -> Num.compare x y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue