{"id":18002859,"url":"https://github.com/am-kantox/lazy_for","last_synced_at":"2025-03-26T08:31:19.307Z","repository":{"id":62429873,"uuid":"209086402","full_name":"am-kantox/lazy_for","owner":"am-kantox","description":"Lazy implementation of `Kernel.SpecialForms.for/1` based on streams","archived":false,"fork":false,"pushed_at":"2024-09-02T06:56:30.000Z","size":464,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T12:22:00.508Z","etag":null,"topics":["comprehension","elixir","elixir-lang","stream","stream-processing"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/am-kantox.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-17T15:10:08.000Z","updated_at":"2024-09-24T04:14:48.000Z","dependencies_parsed_at":"2024-10-29T23:37:04.113Z","dependency_job_id":null,"html_url":"https://github.com/am-kantox/lazy_for","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"e92b8c65d2bded3fa345c0e97518d3c16ac48173"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Flazy_for","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Flazy_for/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Flazy_for/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Flazy_for/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/am-kantox","download_url":"https://codeload.github.com/am-kantox/lazy_for/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245618753,"owners_count":20645061,"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":["comprehension","elixir","elixir-lang","stream","stream-processing"],"created_at":"2024-10-29T23:24:17.442Z","updated_at":"2025-03-26T08:31:18.865Z","avatar_url":"https://github.com/am-kantox.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LazyFor [![Kantox ❤ OSS](https://img.shields.io/badge/❤-kantox_oss-informational.svg)](https://kantox.com/)  ![Test](https://github.com/am-kantox/lazy_for/workflows/Test/badge.svg)  ![Dialyzer](https://github.com/am-kantox/lazy_for/workflows/Dialyzer/badge.svg)  [![Coverage Status](https://coveralls.io/repos/github/am-kantox/lazy_for/badge.svg?branch=master)](https://coveralls.io/github/am-kantox/lazy_for?branch=master)\n\n![Scene in club lounge, by Thomas Rowlandson](https://raw.githubusercontent.com/am-kantox/lazy_for/master/stuff/1118px-British_club_scene.jpg)\n\n_Scene in club lounge, by [Thomas Rowlandson](https://en.wikipedia.org/wiki/Thomas_Rowlandson)_\n\n## About\n\nThe stream-based implementation of [`Kernel.SpecialForms.for/1`](https://hexdocs.pm/elixir/master/Kernel.SpecialForms.html?#for/1).\n\nHas the same syntax as its ancestor, returns a stream.\n\nCurrently supports `Enum.t()` as an input. Examples are gracefully stolen from the ancestor’s docs.\n\n_Examples:_\n\n```elixir\niex\u003e import LazyFor\niex\u003e # A list generator:\niex\u003e result = stream n \u003c- [1, 2, 3, 4], do: n * 2\niex\u003e Enum.to_list(result)\n[2, 4, 6, 8]\n\niex\u003e # A comprehension with two generators\niex\u003e result = stream x \u003c- [1, 2], y \u003c- [2, 3], do: x * y\niex\u003e Enum.to_list(result)\n[2, 3, 4, 6]\n\niex\u003e # A comprehension with a generator and a filter\niex\u003e result = stream n \u003c- [1, 2, 3, 4, 5, 6], rem(n, 2) == 0, do: n\niex\u003e Enum.to_list(result)\n[2, 4, 6]\n\niex\u003e users = [user: \"john\", admin: \"meg\", guest: \"barbara\"]\niex\u003e result = stream {type, name} when type != :guest \u003c- users do\n...\u003e   String.upcase(name)\n...\u003e end\niex\u003e Enum.to_list(result)\n[\"JOHN\", \"MEG\"]\n\niex\u003e Enum.to_list(stream \u003c\u003cc \u003c- \"a b c\"\u003e\u003e, c != ?\\s, do: c)\n'abc'\n```\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:lazy_for, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Changelog\n\n### `v1.1.0`\n\n- `reduce:` optional argument is experimentally supported\n\n### `v1.0.0`\n\n- version bump\n\n### `v0.3.0`\n\n- optional arguments `:into`, `:uniq`, and `:take`\n- remaining: `:reduce`\n\n### `v0.2.0`\n\n- assignments inside the pipeline\n- support for binary comprehensions\n\n## [Documentation](https://hexdocs.pm/lazy_for).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam-kantox%2Flazy_for","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fam-kantox%2Flazy_for","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam-kantox%2Flazy_for/lists"}