diff --git a/example/gleam.toml b/example/gleam.toml index 7eb0c67..4bd3958 100644 --- a/example/gleam.toml +++ b/example/gleam.toml @@ -15,6 +15,7 @@ version = "1.0.0" [dependencies] gleam_stdlib = ">= 0.34.0 and < 2.0.0" glitzer = ">= 1.0.0 and < 2.0.0" +gleam_yielder = ">= 1.1.0 and < 2.0.0" [dev-dependencies] gleeunit = ">= 1.0.0 and < 2.0.0" diff --git a/example/manifest.toml b/example/manifest.toml index edd585b..39948ff 100644 --- a/example/manifest.toml +++ b/example/manifest.toml @@ -6,13 +6,15 @@ packages = [ { name = "gleam_community_colour", version = "1.4.1", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib"], otp_app = "gleam_community_colour", source = "hex", outer_checksum = "386CB9B01B33371538672EEA8A6375A0A0ADEF41F17C86DDCB81C92AD00DA610" }, { name = "gleam_json", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "0A57FB5666E695FD2BEE74C0428A98B0FC11A395D2C7B4CDF5E22C5DD32C74C6" }, { name = "gleam_stdlib", version = "0.45.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "206FCE1A76974AECFC55AEBCD0217D59EDE4E408C016E2CFCCC8FF51278F186E" }, + { name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" }, { name = "glearray", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glearray", source = "hex", outer_checksum = "B99767A9BC63EF9CC8809F66C7276042E5EFEACAA5B25188B552D3691B91AC6D" }, { name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" }, - { name = "glitzer", version = "1.1.3", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_community_colour", "gleam_stdlib", "glearray", "repeatedly"], otp_app = "glitzer", source = "hex", outer_checksum = "6DF96754F7B9B3D467F319C28FFB5154DA89A039294C0448D1DCE9B97D8477D0" }, + { name = "glitzer", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_community_colour", "gleam_stdlib", "gleam_yielder", "glearray", "repeatedly"], otp_app = "glitzer", source = "hex", outer_checksum = "2B0810A9A648400FE1DC1DBA0DA830FB0861A50737CA67F1EA0519ADC9B7816D" }, { name = "repeatedly", version = "2.1.2", build_tools = ["gleam"], requirements = [], otp_app = "repeatedly", source = "hex", outer_checksum = "93AE1938DDE0DC0F7034F32C1BF0D4E89ACEBA82198A1FE21F604E849DA5F589" }, ] [requirements] gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleam_yielder = { version = ">= 1.1.0 and < 2.0.0" } gleeunit = { version = ">= 1.0.0 and < 2.0.0" } glitzer = { version = ">= 1.0.0 and < 2.0.0" } diff --git a/example/src/example.gleam b/example/src/example.gleam index 08a889a..07213eb 100644 --- a/example/src/example.gleam +++ b/example/src/example.gleam @@ -1,5 +1,5 @@ import gleam/int -import gleam/iterator +import gleam/yielder import glitzer/progress import glitzer/spinner @@ -46,13 +46,13 @@ fn do_cool_shit_with_2_it() { let bar = progress.fancy_slim_arrow_bar() |> progress.with_length(100) - let i1 = iterator.range(0, 100) - let i2 = iterator.range(100, 200) - progress.map2_iterator(i1, i2, bar, fn(bar, e1, e2) { + let i1 = yielder.range(0, 100) + let i2 = yielder.range(100, 200) + progress.map2_yielder(i1, i2, bar, fn(bar, e1, e2) { progress.with_left_text(bar, int.to_string(e1) <> " ") |> progress.with_right_text(" " <> int.to_string(e2)) |> progress.print_bar sleep(50) }) - |> iterator.run + |> yielder.run }