Skip to content

Commit 1f7f152

Browse files
committed
up
1 parent b5b5eab commit 1f7f152

8 files changed

Lines changed: 20 additions & 6 deletions

File tree

0 Bytes
Binary file not shown.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
app [main] {
22
pf: platform "../../../platforms/go/main.roc"
33
}
4-
import Lib.Display as Display
4+
import Lib.Display exposing [str]
55
main : Str
6-
main = Display.str [
6+
main = str [
77
["Roc", "<3", "Go", "!", "!", "!"],
88
["This", "is", "a", "Roc", "application", "running", "on", "Go."],
99
["It", "imports", "a", "Roc", "module", "and", "calls", "a", "function", "from", "it."],
1010
]
11+
#matrix 2 3
12+
#[
13+
# ["Roc", "<3", "Go", "!", "!", "!"],
14+
# ["This", "is", "a", "Roc", "application", "running", "on", "Go."],
15+
# ["It", "imports", "a", "Roc", "module", "and", "calls", "a", "function", "from", "it."],
16+
#]
0 Bytes
Binary file not shown.

pkgs/roc/lib/Display.roc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
module [str]
2+
#module [str, matrix]
23
str : List (List Str) -> Str
34
str = |lines| lines
45
|> List.map (\ws -> Str.join_with(ws, " "))
56
|> Str.join_with("\n")
7+
#matrix : Int -> Int -> List (List Str)
8+
#matrix rows cols =
9+
# List.range 0 rows
10+
# |> List.map (\r ->
11+
# List.range 0 cols
12+
# |> List.map (\c -> Num.to_str (r * cols + c))
13+
# )

pkgs/roc/lib/Hello.roc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module [str]
2-
import Lib.Square as Square
2+
import Lib.Square exposing [f64]
33
num : F64
44
num = 8192.0125
55
str : Str
66
str = Str.join_with([
77
"Roc <3 Go!",
8-
Str.join_with([Num.to_str(num), "^2=", Num.to_str(Square.f64(num))], ""),
8+
Str.join_with([Num.to_str(num), "^2=", Num.to_str(f64(num))], ""),
99
"This is a Roc application running on Go.",
1010
"It imports a Roc module and calls a function from it.",
1111
], "\n")

pkgs/roc/platforms/go/dynhost

0 Bytes
Binary file not shown.

pkgs/roc/platforms/go/linux-x64.rh

0 Bytes
Binary file not shown.

pkgs/roc/scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ skip_run=0
1414

1515
eval set -- "$(getopt -o "" --long platform:,app:,static,skip-run,help -- "$@")"
1616
while true; do
17-
case $1 in
17+
case ${1:---} in
1818
--platform)
1919
platform=$2
2020
shift 2
@@ -34,7 +34,7 @@ while true; do
3434
--help) usage ;;
3535
--)
3636
shift
37-
# break
37+
break
3838
;;
3939
# *) usage ;;
4040
*)

0 commit comments

Comments
 (0)