Skip to content

Commit 3286ca2

Browse files
committed
exit
1 parent 0b8c38b commit 3286ca2

File tree

15 files changed

+68
-48
lines changed

15 files changed

+68
-48
lines changed

pkgs/roc/applications/display/go-basic-cli/main.roc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ app [main] {
22
pf: platform "./Platform/main.roc",
33
lib: "./Lib/main.roc",
44
}
5-
import lib.Display exposing [str, matrix]
6-
main : Str
7-
main = str(matrix [261, 23])
5+
import lib.Display exposing [to_str, matrix]
6+
main = to_str(matrix [261, 23])

pkgs/roc/applications/hello/go-basic-cli/main.roc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ app [main] {
22
pf: platform "./Platform/main.roc",
33
lib: "./Lib/main.roc",
44
}
5-
import lib.Hello
6-
main : Str
7-
main = Hello.str "Go"
5+
import lib.Hello exposing [hello]
6+
main = hello "Go"

pkgs/roc/applications/hello/rust-basic-cli-template/main.roc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ app [main!] {
22
pf: platform "./Platform/main.roc",
33
lib: "./Lib/main.roc",
44
}
5-
import lib.Hello
6-
import pf.Stdout
5+
import lib.Hello exposing [hello]
6+
import pf.Stdout exposing [line!]
77
language = "Rust"
8-
main! : {} => Result {} _
9-
main! = |{}|
10-
Stdout.line!(Hello.str language)?
11-
Stdout.line!(Str.join_with(["Roc ❤️", language], " "))?
8+
main! = |_|
9+
line!(hello language)?
10+
line!("Roc ❤️ ${language}")?
1211
Ok({})

pkgs/roc/applications/hello/rust-basic-cli/main.roc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ app [main!] {
22
pf: platform "./Platform/main.roc",
33
lib: "./Lib/main.roc",
44
}
5-
import lib.Hello
6-
import pf.Stdout
5+
import lib.Hello exposing [hello]
6+
import pf.Stdout exposing [line!]
77
language = "Rust"
8-
main! : {} => Result {} _
9-
main! = |{}|
10-
Stdout.line!(Hello.str language)?
11-
Stdout.line!(Str.join_with(["Roc ❤️", language], " "))?
8+
main! = |_|
9+
line!(hello language)?
10+
line!("Roc ❤️ ${language}")?
1211
Ok({})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../lib

pkgs/roc/applications/hello/rust-minimal-cli/main.roc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ main! = |_|
1010
line!(hello language)?
1111
line!("Roc ❤️ ${language}")?
1212
line!(hello!(user)?)?
13-
Ok
13+
Ok({})

pkgs/roc/lib/Display.roc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module [str, matrix]
2-
str : List (List Str) -> Str
3-
str = |lines|
1+
module [to_str, matrix]
2+
to_str : List (List Str) -> Str
3+
to_str = |lines|
44
lines
55
|> List.map (|ws| Str.join_with(ws, "\t"))
66
|> Str.join_with("\n")

pkgs/roc/lib/Hello.roc

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
module [str]
2-
import Square exposing [f64]
3-
num : F64
1+
module [hello]
2+
import Square exposing [square]
43
num = 8192.0125
5-
str : Str -> Str
6-
str = |language|
7-
Str.join_with(
8-
[
9-
Str.join_with(["Roc loves", language], " "),
10-
Str.join_with([Num.to_str(num), "^2=", Num.to_str(f64(num))], ""),
11-
Str.join_with(["This is a Roc application running on ", language, "."], ""),
12-
"It imports a Roc module and calls a function from it.",
13-
],
14-
"\n",
15-
)
4+
hello = |language|
5+
"""
6+
Roc loves ${language}
7+
${Num.to_str(num)}^2=${Num.to_str(square(num))}
8+
This is a Roc application running on ${language}.
9+
It imports a Roc module and calls a function from it.
10+
"""

pkgs/roc/lib/Square.roc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
module [i128, i64, f64]
2-
i128 : I128 -> I128
3-
i128 = |x| x * x
4-
i64 : I64 -> I64
5-
i64 = |x| x * x
6-
f64 : F64 -> F64
7-
f64 = |x| x * x
1+
module [square]
2+
square = |x| x * x
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)