Skip to content

Commit

Permalink
Merge branch 'roc-lang:main' into add-commit-hash-to-version-output
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasnep authored Sep 17, 2024
2 parents f39be79 + 38674ae commit a634d67
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ You can 💜 **sponsor** 💜 Roc on:
- [GitHub](https://github.com/sponsors/roc-lang)
- [Liberapay](https://liberapay.com/roc_lang)

We are very grateful for our corporate sponsors [Vendr](https://www.vendr.com/), [RWX](https://www.rwx.com), [Tweede golf](https://tweedegolf.nl/en), [ohne-makler](https://www.ohne-makler.net), and [Decem](https://www.decem.com.au):
We are very grateful for our corporate sponsors [Tweede golf](https://tweedegolf.nl/en), [ohne-makler](https://www.ohne-makler.net), and [Decem](https://www.decem.com.au):

[<img src="https://user-images.githubusercontent.com/1094080/223597445-81755626-a080-4299-a38c-3c92e7548489.png" height="60" alt="Vendr logo"/>](https://www.vendr.com)
&nbsp;&nbsp;&nbsp;&nbsp;
[<img src="https://github.com/roc-lang/roc/assets/1094080/82c0868e-d23f-42a0-ac2d-c6e6b2e16575" height="60" alt="RWX logo"/>](https://www.rwx.com)
&nbsp;&nbsp;&nbsp;&nbsp;
[<img src="https://user-images.githubusercontent.com/1094080/183123052-856815b1-8cc9-410a-83b0-589f03613188.svg" height="60" alt="tweede golf logo"/>](https://tweedegolf.nl/en)
&nbsp;&nbsp;&nbsp;&nbsp;
[<img src="https://www.ohne-makler.net/static/img/brand/logo.svg" height="60" alt="ohne-makler logo"/>](https://www.ohne-makler.net)
Expand All @@ -35,6 +31,7 @@ If you would like your company to become a corporate sponsor of Roc's developmen

We'd also like to express our gratitude to our generous [individual sponsors](https://github.com/sponsors/roc-lang/)! A special thanks to those sponsoring $25/month or more:

- [Peter Marreck](https://github.com/pmarreck)
- [Barry Moore](https://github.com/chiroptical)
- Eric Andresen
- [Jackson Lucky](https://github.com/jluckyiv)
Expand Down
13 changes: 8 additions & 5 deletions crates/cli/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,23 @@ mod tests {
const FORMATTED_ROC: &str = r#"app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br" }
import pf.Stdout
import pf.Task
import pf.Stdin
main =
Stdout.line! "I'm a Roc application!""#;
Stdout.line! "What's your name?"
name = Stdin.line!
Stdout.line! "Hi $(name)!""#;

const UNFORMATTED_ROC: &str = r#"app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br" }
import pf.Stdout
import pf.Task
import pf.Stdin
main =
Stdout.line! "I'm a Roc application!"
Stdout.line! "What's your name?"
name = Stdin.line!
Stdout.line! "Hi $(name)!"
"#;

fn setup_test_file(dir: &Path, file_name: &str, contents: &str) -> PathBuf {
Expand Down
14 changes: 7 additions & 7 deletions www/content/abilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ You can provide a custom implementation for an ability. This may be useful if a

```roc
Color := [
RGBAu8 U8 U8 U8 U8,
RGBAf32 F32 F32 F32 F32,
RgbaU8 U8 U8 U8 U8,
RgbaF32 F32 F32 F32 F32,
]
implements [
Eq { isEq: colorEquality },
Expand All @@ -230,29 +230,29 @@ colorEquality = \a, b -> colorToU8 a == colorToU8 b
colorToU8 : Color -> (U8, U8, U8, U8)
colorToU8 = \@Color c->
when c is
RGBAu8 r g b a -> (r, g, b, a)
RGBAf32 r g b a -> (f32toU8 r, f32toU8 g, f32toU8 b, f32toU8 a)
RgbaU8 r g b a -> (r, g, b, a)
RgbaF32 r g b a -> (f32toU8 r, f32toU8 g, f32toU8 b, f32toU8 a)
f32toU8 : F32 -> U8
f32toU8 = \f ->
Num.floor (f * 255.0)
fromU8 : U8, U8, U8, U8 -> Color
fromU8 = \r, g, b, a -> @Color (RGBAu8 r g b a)
fromU8 = \r, g, b, a -> @Color (RgbaU8 r g b a)
fromI16 : I16, I16, I16, I16 -> Result Color [OutOfRange]
fromI16 = \r, g, b, a ->
if r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255 then
Err OutOfRange
else
Ok (@Color (RGBAu8 (Num.toU8 r) (Num.toU8 g) (Num.toU8 b) (Num.toU8 a)))
Ok (@Color (RgbaU8 (Num.toU8 r) (Num.toU8 g) (Num.toU8 b) (Num.toU8 a)))
fromF32 : F32, F32, F32, F32 -> Result Color [OutOfRange]
fromF32 = \r, g, b, a ->
if r < 0.0 || r > 1.0 || g < 0.0 || g > 1.0 || b < 0.0 || b > 1.0 || a < 0.0 || a > 1.0 then
Err OutOfRange
else
Ok (@Color (RGBAf32 r g b a))
Ok (@Color (RgbaF32 r g b a))
```

## [Advanced Topic: Defining a new Ability](#defining-a-new-ability) {#defining-a-new-ability}
Expand Down
1 change: 1 addition & 0 deletions www/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ If you would like your organization to become an official sponsor of Roc's devel
We'd also like to express our gratitude to our generous [individual sponsors](https://github.com/sponsors/roc-lang/)! A special thanks to those sponsoring $25/month or more:

<ul id="individual-sponsors">
<li><a href="https://github.com/pmarreck">Peter Marreck</a></li>
<li><a href="https://github.com/chiroptical">Barry Moore</a></li>
<li>Eric Andresen</li>
<li><a href="https://github.com/jluckyiv">Jackson Lucky</a></li>
Expand Down
1 change: 0 additions & 1 deletion www/content/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Here is a Roc application that prints `"Hello, World!"` to the command line:
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br" }
import pf.Stdout
import pf.Task
main =
Stdout.line "Hello, World!"
Expand Down

0 comments on commit a634d67

Please sign in to comment.