{"id":18444938,"url":"https://github.com/filipporanza/unfold","last_synced_at":"2025-04-14T22:56:26.822Z","repository":{"id":57671063,"uuid":"329712752","full_name":"FilippoRanza/unfold","owner":"FilippoRanza","description":"A simple unfold implementation in Rust","archived":false,"fork":false,"pushed_at":"2021-01-19T19:08:08.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:56:23.369Z","etag":null,"topics":["iterator","iterator-library","library","rust","unfold"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/unfold","language":"Rust","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/FilippoRanza.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}},"created_at":"2021-01-14T19:21:52.000Z","updated_at":"2023-09-18T14:07:51.000Z","dependencies_parsed_at":"2022-09-26T20:41:27.324Z","dependency_job_id":null,"html_url":"https://github.com/FilippoRanza/unfold","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilippoRanza%2Funfold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilippoRanza%2Funfold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilippoRanza%2Funfold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilippoRanza%2Funfold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FilippoRanza","download_url":"https://codeload.github.com/FilippoRanza/unfold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975330,"owners_count":21192208,"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":["iterator","iterator-library","library","rust","unfold"],"created_at":"2024-11-06T07:04:20.170Z","updated_at":"2025-04-14T22:56:26.802Z","avatar_url":"https://github.com/FilippoRanza.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unfold\n![Rust](https://github.com/FilippoRanza/unfold/workflows/Rust/badge.svg?branch=master) ![crates.io](https://img.shields.io/crates/v/unfold.svg)\n\nA simple unfold implementation in Rust\n\n\n[unfold](https://en.wikipedia.org/wiki/Fold_(higher-order_function)) let you \ncreate an iterator that, staring from a given initial value, \napplies a given function to the current state, store the result for\nthe next iteration, and return the current state. \n\nUnfold defines an endless iterator: you must stop it *by hand*, like in the \nexample. \n\n## Example\n```rust\nuse unfold::Unfold;\n\n// Create a vector containing the first 5 numbers from the Fibonacci\n// series\nlet fibonacci_numbers: Vec\u003cu64\u003e = Unfold::new(|(a, b)| (b, a + b), (0, 1))\n                                         .map(|(a, _)| a)\n                                         .take(5)  //Unfold iterator never stops.\n                                         .collect();\nassert_eq!(vec![0, 1, 1, 2, 3], fibonacci_numbers);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipporanza%2Funfold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipporanza%2Funfold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipporanza%2Funfold/lists"}