This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Numeric utility functions for working with floating-point values. | |
| ## | |
| ## In particular, [is_approx_eq] and [is_approx_eq_to_places] provide | |
| ## IEEE 754-style hybrid (absolute + relative) tolerance comparison | |
| NumUtils :: [].{ | |
| ## Test whether two F64 values are approximately equal, using a hybrid of | |
| ## absolute and relative tolerance | |
| ## | |
| ## |a - b| <= max(abs_tol, rel_tol * max(|a|, |b|)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app [main!] { | |
| cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.tar.br", | |
| json: "https://github.com/lukewilliamboswell/roc-json/releases/download/0.12.0/1trwx8sltQ-e9Y2rOB4LWUWLS_sFVyETK8Twl0i9qpw.tar.gz", | |
| } | |
| import cli.Http | |
| import cli.Stdout | |
| import json.Json | |
| main! = |_| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app [main!] { | |
| cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/bi5zubJ-_Hva9vxxPq4kNx4WHX6oFs8OP6Ad0tCYlrY.tar.br", | |
| ai: "https://github.com/imclerran/roc-ai/releases/download/v0.9.0/LIMYIvGIjaL4cbOXI6mgjV5pQEdNVE5w_G8ggz1uxGU.tar.br", | |
| } | |
| import ai.Chat | |
| import cli.Env | |
| import cli.Http | |
| import cli.Stdout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app "parse-iso" | |
| packages { | |
| pf: "https://..", | |
| dt: “../package/main.roc” | |
| } | |
| imports [ | |
| pf.Http, | |
| pf.Task.{ Task }, | |
| pf.Stdout, | |
| dt.DateTime, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| group:ex3 | |
| -- | |
| Sailor = { | |
| Sid:number,sname:string,rating:number,age:number | |
| 22,dustin,7,45 | |
| 29,Brutus,1,33 | |
| 31,lubber,8,50 | |
| 32,Andy,8,20 | |
| 58,rusty,10,34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- this is an example | |
| group: homework3 | |
| Customers = { | |
| cid:string, cname:string, city:string | |
| c1, John, Pullman | |
| c2, Alli, Pullman | |
| c3, Kelly, Moscow |