mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +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
|
@ -8,9 +8,10 @@ IO a : Task.Task a []
|
|||
|
||||
main : Task.Task {} []
|
||||
main =
|
||||
Task.after
|
||||
Task.getInt
|
||||
\n ->
|
||||
inputResult <- Task.attempt Task.getInt
|
||||
|
||||
when inputResult is
|
||||
Ok n ->
|
||||
x : Expr
|
||||
x = Var "x"
|
||||
|
||||
|
@ -20,6 +21,10 @@ main =
|
|||
nest deriv n f # original koka n = 10
|
||||
|> Task.map \_ -> {}
|
||||
|
||||
Err GetIntError ->
|
||||
Task.putLine "Error: Failed to get Integer from stdin."
|
||||
|
||||
|
||||
nest : (I64, Expr -> IO Expr), I64, Expr -> IO Expr
|
||||
nest = \f, n, e -> Task.loop { s: n, f, m: n, x: e } nestHelp
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue