Roc syntax to use this platform:
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.18.0/0APbwVN1_p1mJ96tXjaoiUCr8NBGamr8G8Ac_DrXR-o.tar.br" }
Breaking changes
- Rename all functions to
snake_case
#288 - Upgrade to purity inference #257
- Add new custom type
Arg
, update API tomain! : List Arg => Result {} [Exit I32 Str]_
#293
New functions
- Port updates from basic-webserver & basic-ssg
Notable Internal changes
Full Changelog: 0.17.0...0.18.0
Migration guide
-
!
is now part of the function name of effectful functions (= all platform functions), it is no longer syntax sugar forTask.await
. Change:app [main] {
toapp [main!] {
main =
tomain! = \_args ->
-
All basic-cli functions have changed to snake_case naming.
-
Task
is no longer needed, you can switch to usingResult
,=>
is used in the type of a function if it is effectful. Change:Task.ok
toOk
Task.err
toErr
Task
toResult
Task.loop
to a recursive function- You may need to add
Ok {}
as the last line in the main function - Example with
=>
:
rocVersionCheck : Task {} _ rocVersionCheck =
To:
rocVersionCheck! : {} => Result {} _ rocVersionCheck! = \{} ->
-
We recommend the use of the
try
keyword:- replace
Stdout.line! "hello"
withtry Stdout.line! "hello"
- use it instead of
Task.await
- replace
-
HTTP changes:
- in headers:
key
toname
url
touri
mimeType
is gonetimeout
totimeout_ms
- in headers:
Feel free to suggest additions to the migration guide!