{"id":15699267,"url":"https://github.com/casualjim/hie","last_synced_at":"2025-05-09T02:34:21.940Z","repository":{"id":62084301,"uuid":"472616807","full_name":"casualjim/hie","owner":"casualjim","description":"A library for working with iterators through streaming combinators","archived":false,"fork":false,"pushed_at":"2022-11-05T06:50:09.000Z","size":105,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T21:28:31.653Z","etag":null,"topics":["functional-programming","iterators","streaming"],"latest_commit_sha":null,"homepage":"","language":"Go","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/casualjim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-22T04:42:11.000Z","updated_at":"2022-11-07T01:05:12.000Z","dependencies_parsed_at":"2022-10-26T06:07:41.806Z","dependency_job_id":null,"html_url":"https://github.com/casualjim/hie","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/casualjim%2Fhie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casualjim%2Fhie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casualjim%2Fhie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casualjim%2Fhie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casualjim","download_url":"https://codeload.github.com/casualjim/hie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253178071,"owners_count":21866443,"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":["functional-programming","iterators","streaming"],"created_at":"2024-10-03T19:39:34.706Z","updated_at":"2025-05-09T02:34:21.911Z","avatar_url":"https://github.com/casualjim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hie\n\nhasten ye collection operations\n\nHie contains a generic iterable with several functional combiner methods.\n\nThis library is built around the concept of an Iterable which is a very small interface that allows for \nlazy iteration over a sequence of values.  With this you can combine many filter, map and flatmap invocations and they will only be evaluated when the first `Next` method is called.\n\nYou can interrupt both ForEach and Fold so you can stop iterating and throw away the rest of the results.\n\n```go\ntype Iter[T any] interface {\n HasNext() bool\n Next() T\n}\n```\n\nYou can find iter implementations for a slice and an option value.\n\nThere is support for clonable iterators, if the iterator implements a `Clone()` method that returns a single value that is either an `Iter[T]` or a type that implements `Iter[T]` then you can use the `iter.Clone(iterator)` method.\n\n## Combiner\n\n* Map\n* Filter\n* FilterMap\n* FlatMap\n* Flatten\n* Union: return the unique elements contained in the provided iterators\n* Intersect: return the intersection of 2 iterators\n* Concat: combine several iterators into 1\n* TakeN: take the first n items of an iterator\n* Cloned: if the element of the iterator is cloneable it returns an iterator that clones every element\n\n## Terminators\n\n* ForEach\n* Fold\n* Collect\n* Difference\n* Symmetric Difference\n* Find: return an option with the first matching value\n* First: return the first element of a collection as an option\n\n## Option \n\nThis library also contains an Option type that can be used with the same combinators.\n\n## Channel\n\nThis library contains an Iter implementation that's backed by a channel\n\n## What's next\n\nIf I ever find time or the will to add\n\n* an Either type\n* a Result type (left biased either)\n* function composition\n* ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasualjim%2Fhie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasualjim%2Fhie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasualjim%2Fhie/lists"}