{"id":13741693,"url":"https://github.com/shunkeen/zignite","last_synced_at":"2026-04-04T22:42:55.902Z","repository":{"id":56712700,"uuid":"523656791","full_name":"shunkeen/zignite","owner":"shunkeen","description":"A lazy stream (iterator) library for Zig","archived":false,"fork":false,"pushed_at":"2023-01-24T02:21:39.000Z","size":132,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T11:36:32.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shunkeen.png","metadata":{"files":{"readme":"README.example.zig","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-11T09:11:35.000Z","updated_at":"2024-07-25T09:15:31.000Z","dependencies_parsed_at":"2023-02-13T11:45:25.962Z","dependency_job_id":null,"html_url":"https://github.com/shunkeen/zignite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunkeen%2Fzignite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunkeen%2Fzignite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunkeen%2Fzignite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shunkeen%2Fzignite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shunkeen","download_url":"https://codeload.github.com/shunkeen/zignite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253157970,"owners_count":21863203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:01:01.800Z","updated_at":"2026-04-04T22:42:55.869Z","avatar_url":"https://github.com/shunkeen.png","language":"Zig","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"const zignite = @import(\"src/zignite.zig\");\nconst std = @import(\"std\");\n\nfn even(x: usize) bool {\n    return @mod(x, 2) == 0;\n}\n\nconst RepeatTake = zignite.Repeat(usize).Take();\nfn repeatTake(x: usize) RepeatTake {\n    return zignite.repeat(usize, x).take(x);\n}\n\ntest \"Example Code 1\" {\n    const x = zignite\n        .range(usize, 0, 100) //            { 0, 1, ..., 99 }\n        .filter(even) //                    { 0, 2, ..., 98 }\n        .flatMap(RepeatTake, repeatTake) // { 2, 2, 4, 4, 4, 4, ..., 98 }\n        .sum();\n\n    try std.testing.expect(x == 161700);\n}\n\ntest \"Example Code 2\" {\n    const lazy = zignite\n        .range(usize, 1, 10) // { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }\n        .filter(even); //       { 2, 4, 6, 8, 10 }\n\n    try std.testing.expect(lazy.sum() == 30);\n    try std.testing.expect(lazy.product() == 3840);\n}\n\ntest \"Example Code 3\" {\n    const allocator = std.testing.allocator;\n    const slice = \"Example Code 3\";\n\n    // []const u8 -\u003e BoundedArray(u8, 50)\n    const bounded_array = try zignite.fromSlice(u8, slice).toBoundedArray(50);\n\n    // BoundedArray(u8, 50) -\u003e ArrayList(u8)\n    var array_list = try zignite.fromBoundedArray(u8, 50, \u0026bounded_array).toArrayList(allocator);\n    defer array_list.deinit();\n\n    // ArrayList(u8) -\u003e []const u8\n    var buffer: [50]u8 = undefined;\n    const slice2 = zignite.fromArrayList(u8, \u0026array_list).toSlice(\u0026buffer).?;\n\n    try std.testing.expect(std.mem.eql(u8, slice, slice2));\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshunkeen%2Fzignite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshunkeen%2Fzignite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshunkeen%2Fzignite/lists"}