Skip to content

0.18.0

Latest
Compare
Choose a tag to compare
@Anton-4 Anton-4 released this 28 Dec 10:27
· 75 commits to main since this release
0.18.0
029a324

docs

examples

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 to main! : List Arg => Result {} [Exit I32 Str]_ #293

New functions

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 for Task.await. Change:

    • app [main] { to app [main!] {
    • main = to main! = \_args ->
  • All basic-cli functions have changed to snake_case naming.

  • Task is no longer needed, you can switch to using Result, => is used in the type of a function if it is effectful. Change:

    • Task.ok to Ok
    • Task.err to Err
    • Task to Result
    • 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" with try Stdout.line! "hello"
    • use it instead of Task.await
  • HTTP changes:

    • in headers: key to name
    • url to uri
    • mimeType is gone
    • timeout to timeout_ms

Feel free to suggest additions to the migration guide!

Examples of upgrades