Skip to content

Commit

Permalink
chore: Update example manifests and code to use new gs version and fu…
Browse files Browse the repository at this point in the history
…nctions
  • Loading branch information
ThatScalaGuy committed Dec 31, 2024
1 parent e4a8b6b commit c4b80ce
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion examples/01-basic/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
{ name = "gleam_otp", version = "0.16.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "FA0EB761339749B4E82D63016C6A18C4E6662DA05BAB6F1346F9AF2E679E301A" },
{ name = "gleam_stdlib", version = "0.51.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "14AFA8D3DDD7045203D422715DBB822D1725992A31DF35A08D97389014B74B68" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
{ name = "gs", version = "0.0.4", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../.." },
{ name = "gs", version = "0.0.9", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], source = "local", path = "../.." },
]

[requirements]
Expand Down
4 changes: 3 additions & 1 deletion examples/02-advanced/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
{ name = "gleam_otp", version = "0.16.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "FA0EB761339749B4E82D63016C6A18C4E6662DA05BAB6F1346F9AF2E679E301A" },
{ name = "gleam_stdlib", version = "0.51.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "14AFA8D3DDD7045203D422715DBB822D1725992A31DF35A08D97389014B74B68" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
{ name = "gs", version = "0.0.4", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../.." },
{ name = "gs", version = "0.0.9", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], source = "local", path = "../.." },
]

[requirements]
Expand Down
4 changes: 3 additions & 1 deletion examples/03-complex/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
{ name = "gleam_otp", version = "0.16.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "FA0EB761339749B4E82D63016C6A18C4E6662DA05BAB6F1346F9AF2E679E301A" },
{ name = "gleam_stdlib", version = "0.51.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "14AFA8D3DDD7045203D422715DBB822D1725992A31DF35A08D97389014B74B68" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
{ name = "gs", version = "0.0.4", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../.." },
{ name = "gs", version = "0.0.9", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], source = "local", path = "../.." },
]

[requirements]
Expand Down
6 changes: 4 additions & 2 deletions examples/03-complex/src/example.gleam
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import gleam/io
import gs.{debug, filter, fold, from_list, map, take, to_list, to_nil, zip_with}
import gs.{
debug, filter, from_list, map, take, to_fold, to_list, to_nil, zip_with,
}

pub fn main() {
// Create a stream from a list
Expand Down Expand Up @@ -29,6 +31,6 @@ pub fn main() {
result_stream |> debug |> to_nil

// Fold the stream into a single value (sum)
let sum = result_stream |> fold(0, fn(acc, x) { acc + x })
let sum = result_stream |> to_fold(0, fn(acc, x) { acc + x })
io.debug(sum)
}
4 changes: 3 additions & 1 deletion examples/04-stream_processing/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_erlang", version = "0.33.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "A1D26B80F01901B59AABEE3475DD4C18D27D58FA5C897D922FCB9B099749C064" },
{ name = "gleam_otp", version = "0.16.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "FA0EB761339749B4E82D63016C6A18C4E6662DA05BAB6F1346F9AF2E679E301A" },
{ name = "gleam_stdlib", version = "0.51.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "14AFA8D3DDD7045203D422715DBB822D1725992A31DF35A08D97389014B74B68" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
{ name = "gs", version = "0.0.4", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../.." },
{ name = "gs", version = "0.0.9", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], source = "local", path = "../.." },
]

[requirements]
Expand Down
4 changes: 2 additions & 2 deletions examples/04-stream_processing/src/example.gleam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gleam/io
import gs.{
concat, debug, filter, fold, from_list, map, take_while, to_list, to_nil,
concat, debug, filter, from_list, map, take_while, to_fold, to_list, to_nil,
}

pub fn main() {
Expand Down Expand Up @@ -30,6 +30,6 @@ pub fn main() {
result_stream |> debug |> to_nil

// Fold the stream into a single value (product)
let product = result_stream |> fold(1, fn(acc, x) { acc * x })
let product = result_stream |> to_fold(1, fn(acc, x) { acc * x })
io.debug(product)
}

0 comments on commit c4b80ce

Please sign in to comment.