{"id":13411564,"url":"https://github.com/nwillc/genfuncs","last_synced_at":"2026-01-12T13:46:34.008Z","repository":{"id":37487950,"uuid":"439025207","full_name":"nwillc/genfuncs","owner":"nwillc","description":"Go 1.18+ polymorphic generic containers and functions.","archived":false,"fork":false,"pushed_at":"2022-08-07T13:03:44.000Z","size":341,"stargazers_count":49,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-31T20:48:01.253Z","etag":null,"topics":["generics","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwillc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-16T14:48:12.000Z","updated_at":"2024-06-26T20:35:37.000Z","dependencies_parsed_at":"2022-08-08T20:30:38.416Z","dependency_job_id":null,"html_url":"https://github.com/nwillc/genfuncs","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/nwillc/genfuncs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwillc%2Fgenfuncs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwillc%2Fgenfuncs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwillc%2Fgenfuncs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwillc%2Fgenfuncs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwillc","download_url":"https://codeload.github.com/nwillc/genfuncs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwillc%2Fgenfuncs/sbom","scorecard":{"id":699446,"data":{"date":"2025-08-11","repo":{"name":"github.com/nwillc/genfuncs","commit":"217050bf17776529c07df0bb1f985ed5d039b29a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/CI.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/CI.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/nwillc/genfuncs/CI.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/CI.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/nwillc/genfuncs/CI.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/CI.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/nwillc/genfuncs/CI.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: ISC License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T04:50:43.751Z","repository_id":37487950,"created_at":"2025-08-22T04:50:43.751Z","updated_at":"2025-08-22T04:50:43.751Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["generics","go","golang"],"created_at":"2024-07-30T20:01:14.573Z","updated_at":"2026-01-12T13:46:33.671Z","avatar_url":"https://github.com/nwillc.png","language":"Go","readme":"\u003c!-- Code generated by gomarkdoc. DO NOT EDIT --\u003e\n\n[![License](https://img.shields.io/github/license/nwillc/genfuncs.svg)](https://tldrlegal.com/license/-isc-license)\n[![CI](https://github.com/nwillc/genfuncs/workflows/CI/badge.svg)](https://github.com/nwillc/genfuncs/actions/workflows/CI.yml)\n[![codecov.io](https://codecov.io/github/nwillc/genfuncs/coverage.svg?branch=master)](https://codecov.io/github/nwillc/genfuncs?branch=master)\n[![goreportcard.com](https://goreportcard.com/badge/github.com/nwillc/genfuncs)](https://goreportcard.com/report/github.com/nwillc/genfuncs)\n[![Reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white)](https://pkg.go.dev/github.com/nwillc/genfuncs)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n[![Releases](https://img.shields.io/github/tag/nwillc/genfuncs.svg)](https://github.com/nwillc/genfuncs/tags)\n\n# Genfuncs Package\n\nGenfuncs implements various functions utilizing Go's Generics to help avoid writing boilerplate code,\nin particular when working with containers like heap, list, map, queue, set, slice, etc. Many of the functions are\nbased on Kotlin's Sequence and Map. Some functional patterns like Result and Promises are presents. Attempts were also \nmade to introduce more polymorphism into Go's containers. This package, while very usable, is primarily a \nproof-of-concept since it is likely Go will provide similar before long. In fact, golang.org/x/exp/slices \nand golang.org/x/exp/maps offer some similar functions and I incorporate them here.\n\n## Code Style\n\nThe coding style is not always idiomatic, in particular:\n\n - All functions have named return values and those variable are used in the return statements.\n - Some places where the `range` build-in could have been used instead use explicit indexing.\n\nBoth of these, while less idiomatic, were done because they measurably improve performance.\n\n## General notes:\n - A Map interface is provided to allow both Go's normal map and it's sync.Map to be used polymorphically.\n - The bias of these functions where appropriate is to be pure, without side effects, at the cost of copying data.\n - Examples are found in `*examples_test.go` files or projects like [gordle](https://github.com/nwillc/gordle), \n[gorelease](https://github.com/nwillc/gorelease) or [gotimer](https://github.com/nwillc/gotimer).\n\n## License\n\nThe code is under the [ISC License](https://github.com/nwillc/genfuncs/blob/master/LICENSE.md).\n\n## Requirements\n\nBuild with Go 1.18+\n\n## Getting\n\n```bash\ngo get github.com/nwillc/genfuncs\n```\n\n# Packages\n- [genfuncs](\u003c#genfuncs\u003e)\n- [genfuncs/container](\u003c#container\u003e)\n- [genfuncs/container/gmaps](\u003c#gmaps\u003e)\n- [genfuncs/container/gslices](\u003c#gslices\u003e)\n- [genfuncs/container/sequences](\u003c#sequences\u003e)\n- [genfuncs/promises](\u003c#promises\u003e)\n- [genfuncs/results](\u003c#results\u003e)\n\n\n# genfuncs\n\n```go\nimport \"github.com/nwillc/genfuncs\"\n```\n\n## Index\n\n- [Variables](\u003c#variables\u003e)\n- [func Empty[T any]\\(\\) (empty T)](\u003c#func-empty\u003e)\n- [func Max[T constraints.Ordered](v ...T) (max T)](\u003c#func-max\u003e)\n- [func Min[T constraints.Ordered](v ...T) (min T)](\u003c#func-min\u003e)\n- [func Ordered[T constraints.Ordered](a, b T) (order int)](\u003c#func-ordered\u003e)\n- [func OrderedEqual[O constraints.Ordered](a, b O) (orderedEqualTo bool)](\u003c#func-orderedequal\u003e)\n- [func OrderedGreater[O constraints.Ordered](a, b O) (orderedGreaterThan bool)](\u003c#func-orderedgreater\u003e)\n- [func OrderedLess[O constraints.Ordered](a, b O) (orderedLess bool)](\u003c#func-orderedless\u003e)\n- [type BiFunction](\u003c#type-bifunction\u003e)\n  - [func TransformArgs[T1, T2, R any](transform Function[T1, T2], operation BiFunction[T2, T2, R]) (fn BiFunction[T1, T1, R])](\u003c#func-transformargs\u003e)\n- [type Function](\u003c#type-function\u003e)\n  - [func Curried[A, R any](operation BiFunction[A, A, R], a A) (fn Function[A, R])](\u003c#func-curried\u003e)\n  - [func Not[T any](predicate Function[T, bool]) (fn Function[T, bool])](\u003c#func-not\u003e)\n  - [func OrderedEqualTo[O constraints.Ordered](a O) (fn Function[O, bool])](\u003c#func-orderedequalto\u003e)\n  - [func OrderedGreaterThan[O constraints.Ordered](a O) (fn Function[O, bool])](\u003c#func-orderedgreaterthan\u003e)\n  - [func OrderedLessThan[O constraints.Ordered](a O) (fn Function[O, bool])](\u003c#func-orderedlessthan\u003e)\n- [type Promise](\u003c#type-promise\u003e)\n  - [func NewPromise[T any](ctx context.Context, action func(context.Context) *Result[T]) *Promise[T]](\u003c#func-newpromise\u003e)\n  - [func NewPromiseFromResult[T any](result *Result[T]) *Promise[T]](\u003c#func-newpromisefromresult\u003e)\n  - [func (p *Promise[T]) Cancel()](\u003c#func-promiset-cancel\u003e)\n  - [func (p *Promise[T]) OnError(action func(error)) *Promise[T]](\u003c#func-promiset-onerror\u003e)\n  - [func (p *Promise[T]) OnSuccess(action func(t T)) *Promise[T]](\u003c#func-promiset-onsuccess\u003e)\n  - [func (p *Promise[T]) Wait() *Result[T]](\u003c#func-promiset-wait\u003e)\n- [type Result](\u003c#type-result\u003e)\n  - [func NewError[T any](err error) *Result[T]](\u003c#func-newerror\u003e)\n  - [func NewResult[T any](t T) *Result[T]](\u003c#func-newresult\u003e)\n  - [func NewResultError[T any](t T, err error) *Result[T]](\u003c#func-newresulterror\u003e)\n  - [func (r *Result[T]) Error() error](\u003c#func-resultt-error\u003e)\n  - [func (r *Result[T]) MustGet() T](\u003c#func-resultt-mustget\u003e)\n  - [func (r *Result[T]) Ok() bool](\u003c#func-resultt-ok\u003e)\n  - [func (r *Result[T]) OnError(action func(e error)) *Result[T]](\u003c#func-resultt-onerror\u003e)\n  - [func (r *Result[T]) OnSuccess(action func(t T)) *Result[T]](\u003c#func-resultt-onsuccess\u003e)\n  - [func (r *Result[T]) OrElse(v T) T](\u003c#func-resultt-orelse\u003e)\n  - [func (r *Result[T]) OrEmpty() T](\u003c#func-resultt-orempty\u003e)\n  - [func (r *Result[T]) String() string](\u003c#func-resultt-string\u003e)\n  - [func (r *Result[T]) Then(action func(t T) *Result[T]) *Result[T]](\u003c#func-resultt-then\u003e)\n- [type ToString](\u003c#type-tostring\u003e)\n  - [func StringerToString[T fmt.Stringer]\\(\\) (fn ToString[T])](\u003c#func-stringertostring\u003e)\n\n\n## Variables\n\n```go\nvar (\n    // Orderings\n    LessThan    = -1\n    EqualTo     = 0\n    GreaterThan = 1\n\n    // Predicates\n    IsBlank    = OrderedEqualTo(\"\")\n    IsNotBlank = Not(IsBlank)\n    F32IsZero  = OrderedEqualTo(float32(0.0))\n    F64IsZero  = OrderedEqualTo(0.0)\n    IIsZero    = OrderedEqualTo(0)\n)\n```\n\n```go\nvar (\n    // PromiseNoActionErrorMsg indicates a Promise was created for no action.\n    PromiseNoActionErrorMsg = \"promise requested with no action\"\n    // PromisePanicErrorMsg indicates the action of a Promise caused a panic.\n    PromisePanicErrorMsg = \"promise action panic\"\n)\n```\n\n```go\nvar IllegalArguments = fmt.Errorf(\"illegal arguments\")\n```\n\nNoSuchElement error is used by panics when attempts are made to access out of bounds.\n\n```go\nvar NoSuchElement = fmt.Errorf(\"no such element\")\n```\n\n## func [Empty](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L39\u003e)\n\n```go\nfunc Empty[T any]\\(\\) (empty T)\n```\n\nEmpty return an empty value of type T.\n\n## func [Max](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L80\u003e)\n\n```go\nfunc Max[T constraints.Ordered](v ...T) (max T)\n```\n\nMax returns max value one or more constraints.Ordered values,\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/nwillc/genfuncs\"\n)\n\nfunc main() {\n\tfmt.Println(genfuncs.Max(1, 2))\n\twords := []string{\"dog\", \"cat\", \"gorilla\"}\n\tfmt.Println(genfuncs.Max(words...))\n}\n```\n\n#### Output\n\n```\n2\ngorilla\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [Min](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L94\u003e)\n\n```go\nfunc Min[T constraints.Ordered](v ...T) (min T)\n```\n\nMin returns min value of one or more constraints.Ordered values,\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/nwillc/genfuncs\"\n)\n\nfunc main() {\n\tfmt.Println(genfuncs.Min(1, 2))\n\twords := []string{\"dog\", \"cat\", \"gorilla\"}\n\tfmt.Println(genfuncs.Min(words...))\n}\n```\n\n#### Output\n\n```\n1\ncat\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [Ordered](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L134\u003e)\n\n```go\nfunc Ordered[T constraints.Ordered](a, b T) (order int)\n```\n\nOrdered performs old school \\-1/0/1 comparison of constraints.Ordered arguments.\n\n## func [OrderedEqual](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L44\u003e)\n\n```go\nfunc OrderedEqual[O constraints.Ordered](a, b O) (orderedEqualTo bool)\n```\n\nOrderedEqual returns true jf a is ordered equal to b.\n\n## func [OrderedGreater](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L56\u003e)\n\n```go\nfunc OrderedGreater[O constraints.Ordered](a, b O) (orderedGreaterThan bool)\n```\n\nOrderedGreater returns true if a is ordered greater than b.\n\n## func [OrderedLess](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L68\u003e)\n\n```go\nfunc OrderedLess[O constraints.Ordered](a, b O) (orderedLess bool)\n```\n\nOrderedLess returns true if a is ordered less than b.\n\n## type [BiFunction](\u003chttps://github.com/nwillc/genfuncs/blob/master/functions.go#L20\u003e)\n\nBiFunction accepts two arguments and produces a result.\n\n```go\ntype BiFunction[T, U, R any] func(T, U) R\n```\n\n### func [TransformArgs](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L114\u003e)\n\n```go\nfunc TransformArgs[T1, T2, R any](transform Function[T1, T2], operation BiFunction[T2, T2, R]) (fn BiFunction[T1, T1, R])\n```\n\nTransformArgs uses the function to transform the arguments to be passed to the operation.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/nwillc/genfuncs\"\n)\n\nfunc main() {\n\tvar unixTime = func(t time.Time) int64 { return t.Unix() }\n\tvar chronoOrder = genfuncs.TransformArgs(unixTime, genfuncs.OrderedLess[int64])\n\tnow := time.Now()\n\tfmt.Println(chronoOrder(now, now.Add(time.Second)))\n}\n```\n\n#### Output\n\n```\ntrue\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## type [Function](\u003chttps://github.com/nwillc/genfuncs/blob/master/functions.go#L23\u003e)\n\nFunction is a single argument function.\n\n```go\ntype Function[T, R any] func(T) R\n```\n\n### func [Curried](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L122\u003e)\n\n```go\nfunc Curried[A, R any](operation BiFunction[A, A, R], a A) (fn Function[A, R])\n```\n\nCurried takes a BiFunction and one argument, and Curries the function to return a single argument Function.\n\n### func [Not](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L128\u003e)\n\n```go\nfunc Not[T any](predicate Function[T, bool]) (fn Function[T, bool])\n```\n\nNot takes a predicate returning and inverts the result.\n\n### func [OrderedEqualTo](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L50\u003e)\n\n```go\nfunc OrderedEqualTo[O constraints.Ordered](a O) (fn Function[O, bool])\n```\n\nOrderedEqualTo return a function that returns true if its argument is ordered equal to a.\n\n### func [OrderedGreaterThan](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L62\u003e)\n\n```go\nfunc OrderedGreaterThan[O constraints.Ordered](a O) (fn Function[O, bool])\n```\n\nOrderedGreaterThan returns a function that returns true if its argument is ordered greater than a.\n\n### func [OrderedLessThan](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L74\u003e)\n\n```go\nfunc OrderedLessThan[O constraints.Ordered](a O) (fn Function[O, bool])\n```\n\nOrderedLessThan returns a function that returns true if its argument is ordered less than a.\n\n## type [Promise](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L26-L32\u003e)\n\nPromise provides asynchronous Result of an action.\n\n```go\ntype Promise[T any] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func [NewPromise](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L42\u003e)\n\n```go\nfunc NewPromise[T any](ctx context.Context, action func(context.Context) *Result[T]) *Promise[T]\n```\n\nNewPromise creates a Promise for an action.\n\n### func [NewPromiseFromResult](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L77\u003e)\n\n```go\nfunc NewPromiseFromResult[T any](result *Result[T]) *Promise[T]\n```\n\nNewPromiseFromResult returns a completed Promise with the specified result.\n\n### func \\(\\*Promise\\[T\\]\\) [Cancel](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L84\u003e)\n\n```go\nfunc (p *Promise[T]) Cancel()\n```\n\nCancel the Promise which will allow any action that is listening on \\`\\\u003c\\-ctx.Done\\(\\)\\` to complete.\n\n### func \\(\\*Promise\\[T\\]\\) [OnError](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L89\u003e)\n\n```go\nfunc (p *Promise[T]) OnError(action func(error)) *Promise[T]\n```\n\nOnError returns a new Promise with an error handler waiting on the original Promise.\n\n### func \\(\\*Promise\\[T\\]\\) [OnSuccess](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L96\u003e)\n\n```go\nfunc (p *Promise[T]) OnSuccess(action func(t T)) *Promise[T]\n```\n\nOnSuccess returns a new Promise with a success handler waiting on the original Promise.\n\n### func \\(\\*Promise\\[T\\]\\) [Wait](\u003chttps://github.com/nwillc/genfuncs/blob/master/promise.go#L103\u003e)\n\n```go\nfunc (p *Promise[T]) Wait() *Result[T]\n```\n\nWait on the completion of a Promise.\n\n## type [Result](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L26-L29\u003e)\n\nResult is an implementation of the Maybe pattern. This is mostly for experimentation as it is a poor fit with Go's traditional idiomatic error handling.\n\n```go\ntype Result[T any] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func [NewError](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L46\u003e)\n\n```go\nfunc NewError[T any](err error) *Result[T]\n```\n\nNewError for an error.\n\n### func [NewResult](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L36\u003e)\n\n```go\nfunc NewResult[T any](t T) *Result[T]\n```\n\nNewResult for a value.\n\n### func [NewResultError](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L41\u003e)\n\n```go\nfunc NewResultError[T any](t T, err error) *Result[T]\n```\n\nNewResultError creates a Result from a value, error tuple.\n\n### func \\(\\*Result\\[T\\]\\) [Error](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L55\u003e)\n\n```go\nfunc (r *Result[T]) Error() error\n```\n\nError of the Result, nil if Ok\\(\\).\n\n### func \\(\\*Result\\[T\\]\\) [MustGet](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L112\u003e)\n\n```go\nfunc (r *Result[T]) MustGet() T\n```\n\nMustGet returns the value of the Result if Ok\\(\\) or if not, panics with the error.\n\n### func \\(\\*Result\\[T\\]\\) [Ok](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L69\u003e)\n\n```go\nfunc (r *Result[T]) Ok() bool\n```\n\nOk returns the status of Result, is it ok, or an error.\n\n### func \\(\\*Result\\[T\\]\\) [OnError](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L74\u003e)\n\n```go\nfunc (r *Result[T]) OnError(action func(e error)) *Result[T]\n```\n\nOnError performs the action if Result is not Ok\\(\\).\n\n### func \\(\\*Result\\[T\\]\\) [OnSuccess](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L82\u003e)\n\n```go\nfunc (r *Result[T]) OnSuccess(action func(t T)) *Result[T]\n```\n\nOnSuccess performs action if Result is Ok\\(\\).\n\n### func \\(\\*Result\\[T\\]\\) [OrElse](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L99\u003e)\n\n```go\nfunc (r *Result[T]) OrElse(v T) T\n```\n\nOrElse returns the value of the Result if Ok\\(\\), or the value v if not.\n\n### func \\(\\*Result\\[T\\]\\) [OrEmpty](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L107\u003e)\n\n```go\nfunc (r *Result[T]) OrEmpty() T\n```\n\nOrEmpty will return the value of the Result or the empty value if Error.\n\n### func \\(\\*Result\\[T\\]\\) [String](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L90\u003e)\n\n```go\nfunc (r *Result[T]) String() string\n```\n\nString returns a string representation of Result, either the value or error.\n\n### func \\(\\*Result\\[T\\]\\) [Then](\u003chttps://github.com/nwillc/genfuncs/blob/master/result.go#L60\u003e)\n\n```go\nfunc (r *Result[T]) Then(action func(t T) *Result[T]) *Result[T]\n```\n\nThen performs the action on the Result.\n\n## type [ToString](\u003chttps://github.com/nwillc/genfuncs/blob/master/functions.go#L26\u003e)\n\nToString is used to create string representations, it accepts any type and returns a string.\n\n```go\ntype ToString[T any] func(T) string\n```\n\n### func [StringerToString](\u003chttps://github.com/nwillc/genfuncs/blob/master/dry.go#L108\u003e)\n\n```go\nfunc StringerToString[T fmt.Stringer]() (fn ToString[T])\n```\n\nStringerToString creates a ToString for any type that implements fmt.Stringer.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/nwillc/genfuncs\"\n)\n\nfunc main() {\n\tvar epoch time.Time\n\tfmt.Println(epoch.String())\n\tstringer := genfuncs.StringerToString[time.Time]()\n\tfmt.Println(stringer(epoch))\n}\n```\n\n#### Output\n\n```\n0001-01-01 00:00:00 +0000 UTC\n0001-01-01 00:00:00 +0000 UTC\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n# container\n\n```go\nimport \"github.com/nwillc/genfuncs/container\"\n```\n\n## Index\n\n- [type Container](\u003c#type-container\u003e)\n- [type Deque](\u003c#type-deque\u003e)\n  - [func NewDeque[T any](t ...T) (degue *Deque[T])](\u003c#func-newdeque\u003e)\n  - [func (d *Deque[T]) Add(t T)](\u003c#func-dequet-add\u003e)\n  - [func (d *Deque[T]) AddAll(t ...T)](\u003c#func-dequet-addall\u003e)\n  - [func (d *Deque[T]) AddLeft(t T)](\u003c#func-dequet-addleft\u003e)\n  - [func (d *Deque[T]) AddRight(t T)](\u003c#func-dequet-addright\u003e)\n  - [func (d *Deque[T]) Iterator() Iterator[T]](\u003c#func-dequet-iterator\u003e)\n  - [func (d *Deque[T]) Len() (length int)](\u003c#func-dequet-len\u003e)\n  - [func (d *Deque[T]) Peek() (value T)](\u003c#func-dequet-peek\u003e)\n  - [func (d *Deque[T]) PeekLeft() (value T)](\u003c#func-dequet-peekleft\u003e)\n  - [func (d *Deque[T]) PeekRight() (value T)](\u003c#func-dequet-peekright\u003e)\n  - [func (d *Deque[T]) Remove() (value T)](\u003c#func-dequet-remove\u003e)\n  - [func (d *Deque[T]) RemoveLeft() (value T)](\u003c#func-dequet-removeleft\u003e)\n  - [func (d *Deque[T]) RemoveRight() (value T)](\u003c#func-dequet-removeright\u003e)\n  - [func (d *Deque[T]) Values() (values GSlice[T])](\u003c#func-dequet-values\u003e)\n- [type GMap](\u003c#type-gmap\u003e)\n  - [func (m GMap[K, V]) All(predicate genfuncs.Function[V, bool]) (ok bool)](\u003c#func-gmapk-v-all\u003e)\n  - [func (m GMap[K, V]) Any(predicate genfuncs.Function[V, bool]) (ok bool)](\u003c#func-gmapk-v-any\u003e)\n  - [func (m GMap[K, V]) Contains(key K) (isTrue bool)](\u003c#func-gmapk-v-contains\u003e)\n  - [func (m GMap[K, V]) Delete(key K)](\u003c#func-gmapk-v-delete\u003e)\n  - [func (m GMap[K, V]) Filter(predicate genfuncs.Function[V, bool]) (result GMap[K, V])](\u003c#func-gmapk-v-filter\u003e)\n  - [func (m GMap[K, V]) FilterKeys(predicate genfuncs.Function[K, bool]) (result GMap[K, V])](\u003c#func-gmapk-v-filterkeys\u003e)\n  - [func (m GMap[K, V]) ForEach(action func(k K, v V))](\u003c#func-gmapk-v-foreach\u003e)\n  - [func (m GMap[K, V]) Get(key K) (v V, ok bool)](\u003c#func-gmapk-v-get\u003e)\n  - [func (m GMap[K, V]) GetOrElse(k K, defaultValue func() V) (value V)](\u003c#func-gmapk-v-getorelse\u003e)\n  - [func (m GMap[K, V]) Iterator() Iterator[V]](\u003c#func-gmapk-v-iterator\u003e)\n  - [func (m GMap[K, V]) Keys() (keys GSlice[K])](\u003c#func-gmapk-v-keys\u003e)\n  - [func (m GMap[K, V]) Len() (length int)](\u003c#func-gmapk-v-len\u003e)\n  - [func (m GMap[K, V]) Put(key K, value V)](\u003c#func-gmapk-v-put\u003e)\n  - [func (m GMap[K, V]) Values() (values GSlice[V])](\u003c#func-gmapk-v-values\u003e)\n- [type GSlice](\u003c#type-gslice\u003e)\n  - [func (s GSlice[T]) Filter(predicate genfuncs.Function[T, bool]) GSlice[T]](\u003c#func-gslicet-filter\u003e)\n  - [func (s GSlice[T]) ForEach(action func(i int, t T))](\u003c#func-gslicet-foreach\u003e)\n  - [func (s GSlice[T]) Iterator() Iterator[T]](\u003c#func-gslicet-iterator\u003e)\n  - [func (s GSlice[T]) Len() int](\u003c#func-gslicet-len\u003e)\n  - [func (s GSlice[T]) Random() (t T)](\u003c#func-gslicet-random\u003e)\n  - [func (s GSlice[T]) SortBy(order genfuncs.BiFunction[T, T, bool]) (sorted GSlice[T])](\u003c#func-gslicet-sortby\u003e)\n  - [func (s GSlice[T]) Swap(i, j int)](\u003c#func-gslicet-swap\u003e)\n  - [func (s GSlice[T]) Values() (values GSlice[T])](\u003c#func-gslicet-values\u003e)\n- [type HasValues](\u003c#type-hasvalues\u003e)\n- [type Heap](\u003c#type-heap\u003e)\n  - [func NewHeap[T any](compare genfuncs.BiFunction[T, T, bool], values ...T) (heap *Heap[T])](\u003c#func-newheap\u003e)\n  - [func (h *Heap[T]) Add(v T)](\u003c#func-heapt-add\u003e)\n  - [func (h *Heap[T]) AddAll(values ...T)](\u003c#func-heapt-addall\u003e)\n  - [func (h *Heap[T]) Len() (length int)](\u003c#func-heapt-len\u003e)\n  - [func (h *Heap[T]) Peek() (value T)](\u003c#func-heapt-peek\u003e)\n  - [func (h *Heap[T]) Remove() (value T)](\u003c#func-heapt-remove\u003e)\n  - [func (h *Heap[T]) Values() (values GSlice[T])](\u003c#func-heapt-values\u003e)\n- [type Iterator](\u003c#type-iterator\u003e)\n  - [func NewListIterator[T any](list *List[T]) Iterator[T]](\u003c#func-newlistiterator\u003e)\n  - [func NewSliceIterator[T any](slice []T) Iterator[T]](\u003c#func-newsliceiterator\u003e)\n  - [func NewValuesIterator[T any](values ...T) Iterator[T]](\u003c#func-newvaluesiterator\u003e)\n- [type List](\u003c#type-list\u003e)\n  - [func NewList[T any](values ...T) (l *List[T])](\u003c#func-newlist\u003e)\n  - [func (l *List[T]) Add(value T)](\u003c#func-listt-add\u003e)\n  - [func (l *List[T]) AddAll(values ...T)](\u003c#func-listt-addall\u003e)\n  - [func (l *List[T]) AddLeft(value T) (e *ListElement[T])](\u003c#func-listt-addleft\u003e)\n  - [func (l *List[T]) AddRight(v T) (e *ListElement[T])](\u003c#func-listt-addright\u003e)\n  - [func (l *List[T]) ForEach(action func(value T))](\u003c#func-listt-foreach\u003e)\n  - [func (l *List[T]) Iterator() Iterator[T]](\u003c#func-listt-iterator\u003e)\n  - [func (l *List[T]) Len() (length int)](\u003c#func-listt-len\u003e)\n  - [func (l *List[T]) PeekLeft() (e *ListElement[T])](\u003c#func-listt-peekleft\u003e)\n  - [func (l *List[T]) PeekRight() (e *ListElement[T])](\u003c#func-listt-peekright\u003e)\n  - [func (l *List[T]) Remove(e *ListElement[T]) (t T)](\u003c#func-listt-remove\u003e)\n  - [func (l *List[T]) SortBy(order genfuncs.BiFunction[T, T, bool]) (result *List[T])](\u003c#func-listt-sortby\u003e)\n  - [func (l *List[T]) Values() (values GSlice[T])](\u003c#func-listt-values\u003e)\n- [type ListElement](\u003c#type-listelement\u003e)\n  - [func (e *ListElement[T]) Next() (next *ListElement[T])](\u003c#func-listelementt-next\u003e)\n  - [func (e *ListElement[T]) Prev() (prev *ListElement[T])](\u003c#func-listelementt-prev\u003e)\n  - [func (e *ListElement[T]) Swap(e2 *ListElement[T])](\u003c#func-listelementt-swap\u003e)\n- [type Map](\u003c#type-map\u003e)\n- [type MapSet](\u003c#type-mapset\u003e)\n  - [func (h *MapSet[T]) Add(t T)](\u003c#func-mapsett-add\u003e)\n  - [func (h *MapSet[T]) AddAll(t ...T)](\u003c#func-mapsett-addall\u003e)\n  - [func (h *MapSet[T]) Contains(t T) (ok bool)](\u003c#func-mapsett-contains\u003e)\n  - [func (h *MapSet[T]) Iterator() Iterator[T]](\u003c#func-mapsett-iterator\u003e)\n  - [func (h *MapSet[T]) Len() (length int)](\u003c#func-mapsett-len\u003e)\n  - [func (h *MapSet[T]) Remove(t T)](\u003c#func-mapsett-remove\u003e)\n  - [func (h *MapSet[T]) Values() (values GSlice[T])](\u003c#func-mapsett-values\u003e)\n- [type Queue](\u003c#type-queue\u003e)\n- [type Sequence](\u003c#type-sequence\u003e)\n  - [func NewIteratorSequence[T any](iterator Iterator[T]) Sequence[T]](\u003c#func-newiteratorsequence\u003e)\n- [type Set](\u003c#type-set\u003e)\n  - [func NewMapSet[T comparable](t ...T) (set Set[T])](\u003c#func-newmapset\u003e)\n- [type SyncMap](\u003c#type-syncmap\u003e)\n  - [func NewSyncMap[K any, V any]\\(\\) (syncMap *SyncMap[K, V])](\u003c#func-newsyncmap\u003e)\n  - [func (s *SyncMap[K, V]) Contains(key K) (contains bool)](\u003c#func-syncmapk-v-contains\u003e)\n  - [func (s *SyncMap[K, V]) Delete(key K)](\u003c#func-syncmapk-v-delete\u003e)\n  - [func (s *SyncMap[K, V]) ForEach(f func(key K, value V))](\u003c#func-syncmapk-v-foreach\u003e)\n  - [func (s *SyncMap[K, V]) Get(key K) (value V, ok bool)](\u003c#func-syncmapk-v-get\u003e)\n  - [func (s *SyncMap[K, V]) GetAndDelete(key K) (value V, ok bool)](\u003c#func-syncmapk-v-getanddelete\u003e)\n  - [func (s *SyncMap[K, V]) GetOrPut(key K, value V) (actual V, ok bool)](\u003c#func-syncmapk-v-getorput\u003e)\n  - [func (s *SyncMap[K, V]) Iterator() Iterator[V]](\u003c#func-syncmapk-v-iterator\u003e)\n  - [func (s *SyncMap[K, V]) Keys() (keys GSlice[K])](\u003c#func-syncmapk-v-keys\u003e)\n  - [func (s *SyncMap[K, V]) Len() (length int)](\u003c#func-syncmapk-v-len\u003e)\n  - [func (s *SyncMap[K, V]) Put(key K, value V)](\u003c#func-syncmapk-v-put\u003e)\n  - [func (s *SyncMap[K, V]) Values() (values GSlice[V])](\u003c#func-syncmapk-v-values\u003e)\n\n\n## type [Container](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/container.go#L20-L26\u003e)\n\nContainer is a minimal container that HasValues and accepts additional elements.\n\n```go\ntype Container[T any] interface {\n\n    // Add an element to the Container.\n    Add(t T)\n    // AddAll elements to the Container.\n    AddAll(t ...T)\n    // contains filtered or unexported methods\n}\n```\n\n## type [Deque](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L25-L27\u003e)\n\nDeque is a doubly ended implementation of Queue with default behavior of a Fifo but provides left and right access. Employs a List for storage.\n\n```go\ntype Deque[T any] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func [NewDeque](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L30\u003e)\n\n```go\nfunc NewDeque[T any](t ...T) (degue *Deque[T])\n```\n\nNewDeque creates a Deque containing any provided elements.\n\n### func \\(\\*Deque\\[T\\]\\) [Add](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L37\u003e)\n\n```go\nfunc (d *Deque[T]) Add(t T)\n```\n\nAdd an element to the right of the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [AddAll](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L42\u003e)\n\n```go\nfunc (d *Deque[T]) AddAll(t ...T)\n```\n\nAddAll elements to the right of the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [AddLeft](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L47\u003e)\n\n```go\nfunc (d *Deque[T]) AddLeft(t T)\n```\n\nAddLeft an element to the left of the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [AddRight](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L52\u003e)\n\n```go\nfunc (d *Deque[T]) AddRight(t T)\n```\n\nAddRight an element to the right of the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L56\u003e)\n\n```go\nfunc (d *Deque[T]) Iterator() Iterator[T]\n```\n\n### func \\(\\*Deque\\[T\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L61\u003e)\n\n```go\nfunc (d *Deque[T]) Len() (length int)\n```\n\nLen reports the length of the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [Peek](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L67\u003e)\n\n```go\nfunc (d *Deque[T]) Peek() (value T)\n```\n\nPeek returns the left most element in the Deque without removing it.\n\n### func \\(\\*Deque\\[T\\]\\) [PeekLeft](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L73\u003e)\n\n```go\nfunc (d *Deque[T]) PeekLeft() (value T)\n```\n\nPeekLeft returns the left most element in the Deque without removing it.\n\n### func \\(\\*Deque\\[T\\]\\) [PeekRight](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L82\u003e)\n\n```go\nfunc (d *Deque[T]) PeekRight() (value T)\n```\n\nPeekRight returns the right most element in the Deque without removing it.\n\n### func \\(\\*Deque\\[T\\]\\) [Remove](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L91\u003e)\n\n```go\nfunc (d *Deque[T]) Remove() (value T)\n```\n\nRemove and return the left most element in the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [RemoveLeft](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L97\u003e)\n\n```go\nfunc (d *Deque[T]) RemoveLeft() (value T)\n```\n\nRemoveLeft and return the left most element in the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [RemoveRight](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L107\u003e)\n\n```go\nfunc (d *Deque[T]) RemoveRight() (value T)\n```\n\nRemoveRight and return the right most element in the Deque.\n\n### func \\(\\*Deque\\[T\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/deque.go#L117\u003e)\n\n```go\nfunc (d *Deque[T]) Values() (values GSlice[T])\n```\n\nValues in the Deque returned in a new GSlice.\n\n## type [GMap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L33\u003e)\n\nGMap is a generic type employing the standard Go map and implementation Map.\n\n```go\ntype GMap[K comparable, V any] map[K]V\n```\n\n### func \\(GMap\\[K, V\\]\\) [All](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L41\u003e)\n\n```go\nfunc (m GMap[K, V]) All(predicate genfuncs.Function[V, bool]) (ok bool)\n```\n\nAll returns true if all values in GMap satisfy the predicate.\n\n### func \\(GMap\\[K, V\\]\\) [Any](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L52\u003e)\n\n```go\nfunc (m GMap[K, V]) Any(predicate genfuncs.Function[V, bool]) (ok bool)\n```\n\nAny returns true if any values in GMap satisfy the predicate.\n\n### func \\(GMap\\[K, V\\]\\) [Contains](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L63\u003e)\n\n```go\nfunc (m GMap[K, V]) Contains(key K) (isTrue bool)\n```\n\nContains returns true if the GMap contains the given key.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nvar wordPositions = container.GMap[string, int]{\"hello\": 1, \"world\": 2}\n\nfunc main() {\n\tfmt.Println(wordPositions.Contains(\"hello\"))\n\tfmt.Println(wordPositions.Contains(\"no\"))\n}\n```\n\n#### Output\n\n```\ntrue\nfalse\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### func \\(GMap\\[K, V\\]\\) [Delete](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L69\u003e)\n\n```go\nfunc (m GMap[K, V]) Delete(key K)\n```\n\nDelete an entry in the GMap.\n\n### func \\(GMap\\[K, V\\]\\) [Filter](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L74\u003e)\n\n```go\nfunc (m GMap[K, V]) Filter(predicate genfuncs.Function[V, bool]) (result GMap[K, V])\n```\n\nFilter a GMap by a predicate, returning a new GMap that contains only values that satisfy the predicate.\n\n### func \\(GMap\\[K, V\\]\\) [FilterKeys](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L86\u003e)\n\n```go\nfunc (m GMap[K, V]) FilterKeys(predicate genfuncs.Function[K, bool]) (result GMap[K, V])\n```\n\nFilterKeys returns a new GMap that contains only values whose key satisfy the predicate.\n\n### func \\(GMap\\[K, V\\]\\) [ForEach](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L98\u003e)\n\n```go\nfunc (m GMap[K, V]) ForEach(action func(k K, v V))\n```\n\nForEach performs the given action on each entry in the GMap.\n\n### func \\(GMap\\[K, V\\]\\) [Get](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L105\u003e)\n\n```go\nfunc (m GMap[K, V]) Get(key K) (v V, ok bool)\n```\n\nGet returns an entry from the Map. The returned bool indicates if the key is in the Map.\n\n### func \\(GMap\\[K, V\\]\\) [GetOrElse](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L111\u003e)\n\n```go\nfunc (m GMap[K, V]) GetOrElse(k K, defaultValue func() V) (value V)\n```\n\nGetOrElse returns the value at the given key if it exists or returns the result of defaultValue.\n\n### func \\(GMap\\[K, V\\]\\) [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L122\u003e)\n\n```go\nfunc (m GMap[K, V]) Iterator() Iterator[V]\n```\n\nIterator creates an iterator for the values in the GMap.\n\n### func \\(GMap\\[K, V\\]\\) [Keys](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L127\u003e)\n\n```go\nfunc (m GMap[K, V]) Keys() (keys GSlice[K])\n```\n\nKeys return a GSlice containing the keys of the GMap.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nvar wordPositions = container.GMap[string, int]{\"hello\": 1, \"world\": 2}\n\nfunc main() {\n\tfmt.Println(wordPositions.Keys().SortBy(genfuncs.OrderedLess[string]))\n}\n```\n\n#### Output\n\n```\n[hello world]\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### func \\(GMap\\[K, V\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L133\u003e)\n\n```go\nfunc (m GMap[K, V]) Len() (length int)\n```\n\nLen is the number of elements in the GMap.\n\n### func \\(GMap\\[K, V\\]\\) [Put](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L139\u003e)\n\n```go\nfunc (m GMap[K, V]) Put(key K, value V)\n```\n\nPut a key and value in the Map.\n\n### func \\(GMap\\[K, V\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gmap.go#L144\u003e)\n\n```go\nfunc (m GMap[K, V]) Values() (values GSlice[V])\n```\n\nValues returns a GSlice of all the values in the GMap.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nvar wordPositions = container.GMap[string, int]{\"hello\": 1, \"world\": 2}\n\nfunc main() {\n\twordPositions.Values().ForEach(func(_, i int) { fmt.Println(i) })\n}\n```\n\n#### Output\n\n```\n1\n2\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## type [GSlice](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L35\u003e)\n\nGSlice is a generic type corresponding to a standard Go slice that implements HasValues.\n\n```go\ntype GSlice[T any] []T\n```\n\n### func \\(GSlice\\[T\\]\\) [Filter](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L43\u003e)\n\n```go\nfunc (s GSlice[T]) Filter(predicate genfuncs.Function[T, bool]) GSlice[T]\n```\n\nFilter returns a slice containing only elements matching the given predicate.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nvar isGreaterThanZero = genfuncs.OrderedGreaterThan(0)\n\nfunc main() {\n\tvar values container.GSlice[int] = []int{1, -2, 2, -3}\n\tvalues.Filter(isGreaterThanZero).ForEach(func(_, i int) {\n\t\tfmt.Println(i)\n\t})\n}\n```\n\n#### Output\n\n```\n1\n2\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### func \\(GSlice\\[T\\]\\) [ForEach](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L58\u003e)\n\n```go\nfunc (s GSlice[T]) ForEach(action func(i int, t T))\n```\n\nForEach element of the GSlice invoke given function with the element. Syntactic sugar for a range that intends to traverse all the elements, i.e. no exiting midway through.\n\n### func \\(GSlice\\[T\\]\\) [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L66\u003e)\n\n```go\nfunc (s GSlice[T]) Iterator() Iterator[T]\n```\n\nIterator returns an Iterator that will iterate over the GSlice.\n\n### func \\(GSlice\\[T\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L71\u003e)\n\n```go\nfunc (s GSlice[T]) Len() int\n```\n\nLen is the number of elements in the GSlice.\n\n### func \\(GSlice\\[T\\]\\) [Random](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L76\u003e)\n\n```go\nfunc (s GSlice[T]) Random() (t T)\n```\n\nRandom returns a random element of the GSlice.\n\n### func \\(GSlice\\[T\\]\\) [SortBy](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L83\u003e)\n\n```go\nfunc (s GSlice[T]) SortBy(order genfuncs.BiFunction[T, T, bool]) (sorted GSlice[T])\n```\n\nSortBy copies a slice, sorts the copy applying the Ordered and returns it. This is not a pure function, the GSlice is sorted in place, the returned slice is to allow for fluid calls in chains.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nfunc main() {\n\tvar numbers container.GSlice[int] = []int{1, 0, 9, 6, 0}\n\tfmt.Println(numbers)\n\tfmt.Println(numbers.SortBy(genfuncs.OrderedLess[int]))\n}\n```\n\n#### Output\n\n```\n[1 0 9 6 0]\n[0 0 1 6 9]\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### func \\(GSlice\\[T\\]\\) [Swap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L90\u003e)\n\n```go\nfunc (s GSlice[T]) Swap(i, j int)\n```\n\nSwap two values in the slice.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nvar words container.GSlice[string] = []string{\"hello\", \"world\"}\n\nfunc main() {\n\twords = words.SortBy(genfuncs.OrderedLess[string])\n\twords.Swap(0, 1)\n\tfmt.Println(words)\n}\n```\n\n#### Output\n\n```\n[world hello]\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### func \\(GSlice\\[T\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L95\u003e)\n\n```go\nfunc (s GSlice[T]) Values() (values GSlice[T])\n```\n\nValues is the GSlice itself.\n\n## type [HasValues](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/has_values.go#L20-L25\u003e)\n\nHasValues is an interface that indicates a struct contains values that can counted and be retrieved.\n\n```go\ntype HasValues[T any] interface {\n    // Len returns length of the Container.\n    Len() int\n    // Values returns a copy of the current values in the Container without modifying the contents.\n    Values() GSlice[T]\n}\n```\n\n## type [Heap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L28-L32\u003e)\n\nHeap implements an ordered heap of any type which can be min heap or max heap depending on the compare provided. Heap implements Queue.\n\n```go\ntype Heap[T any] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func [NewHeap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L35\u003e)\n\n```go\nfunc NewHeap[T any](compare genfuncs.BiFunction[T, T, bool], values ...T) (heap *Heap[T])\n```\n\nNewHeap return a heap ordered based on the compare and adds any values provided.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n)\n\nfunc main() {\n\theap := container.NewHeap[int](genfuncs.OrderedLess[int], 3, 1, 4, 2)\n\tfor heap.Len() \u003e 0 {\n\t\tfmt.Print(heap.Remove())\n\t}\n\tfmt.Println()\n}\n```\n\n#### Output\n\n```\n1234\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### func \\(\\*Heap\\[T\\]\\) [Add](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L45\u003e)\n\n```go\nfunc (h *Heap[T]) Add(v T)\n```\n\nAdd a value onto the heap.\n\n### func \\(\\*Heap\\[T\\]\\) [AddAll](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L52\u003e)\n\n```go\nfunc (h *Heap[T]) AddAll(values ...T)\n```\n\nAddAll the values onto the Heap.\n\n### func \\(\\*Heap\\[T\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L61\u003e)\n\n```go\nfunc (h *Heap[T]) Len() (length int)\n```\n\nLen returns current length of the heap.\n\n### func \\(\\*Heap\\[T\\]\\) [Peek](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L64\u003e)\n\n```go\nfunc (h *Heap[T]) Peek() (value T)\n```\n\nPeek returns the next element without removing it.\n\n### func \\(\\*Heap\\[T\\]\\) [Remove](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L79\u003e)\n\n```go\nfunc (h *Heap[T]) Remove() (value T)\n```\n\nRemove an item off the heap.\n\n### func \\(\\*Heap\\[T\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/heap.go#L87\u003e)\n\n```go\nfunc (h *Heap[T]) Values() (values GSlice[T])\n```\n\nValues returns a slice of the values in the Heap in no particular order.\n\n## type [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/iterator.go#L24-L27\u003e)\n\n```go\ntype Iterator[T any] interface {\n    HasNext() bool\n    Next() T\n}\n```\n\n### func [NewListIterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L217\u003e)\n\n```go\nfunc NewListIterator[T any](list *List[T]) Iterator[T]\n```\n\n### func [NewSliceIterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L100\u003e)\n\n```go\nfunc NewSliceIterator[T any](slice []T) Iterator[T]\n```\n\n### func [NewValuesIterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslice.go#L104\u003e)\n\n```go\nfunc NewValuesIterator[T any](values ...T) Iterator[T]\n```\n\n## type [List](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L38-L41\u003e)\n\nList is a doubly linked list, inspired by list.List but reworked to be generic. List implements Container.\n\n```go\ntype List[T any] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func [NewList](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L74\u003e)\n\n```go\nfunc NewList[T any](values ...T) (l *List[T])\n```\n\nNewList instantiates a new List containing any values provided.\n\n### func \\(\\*List\\[T\\]\\) [Add](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L84\u003e)\n\n```go\nfunc (l *List[T]) Add(value T)\n```\n\nAdd a value to the right of the List.\n\n### func \\(\\*List\\[T\\]\\) [AddAll](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L89\u003e)\n\n```go\nfunc (l *List[T]) AddAll(values ...T)\n```\n\nAddAll values to the right of the List.\n\n### func \\(\\*List\\[T\\]\\) [AddLeft](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L99\u003e)\n\n```go\nfunc (l *List[T]) AddLeft(value T) (e *ListElement[T])\n```\n\nAddLeft adds a value to the left of the List.\n\n### func \\(\\*List\\[T\\]\\) [AddRight](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L105\u003e)\n\n```go\nfunc (l *List[T]) AddRight(v T) (e *ListElement[T])\n```\n\nAddRight adds a value to the right of the List.\n\n### func \\(\\*List\\[T\\]\\) [ForEach](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L111\u003e)\n\n```go\nfunc (l *List[T]) ForEach(action func(value T))\n```\n\nForEach invokes the action for each value in the list.\n\n### func \\(\\*List\\[T\\]\\) [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L118\u003e)\n\n```go\nfunc (l *List[T]) Iterator() Iterator[T]\n```\n\nIterator creates an Iterator for the List.\n\n### func \\(\\*List\\[T\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L123\u003e)\n\n```go\nfunc (l *List[T]) Len() (length int)\n```\n\nLen returns the number of values in the List.\n\n### func \\(\\*List\\[T\\]\\) [PeekLeft](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L129\u003e)\n\n```go\nfunc (l *List[T]) PeekLeft() (e *ListElement[T])\n```\n\nPeekLeft returns the leftmost value in the List or nil if empty.\n\n### func \\(\\*List\\[T\\]\\) [PeekRight](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L137\u003e)\n\n```go\nfunc (l *List[T]) PeekRight() (e *ListElement[T])\n```\n\nPeekRight returns the rightmost value in the List or nil if empty.\n\n### func \\(\\*List\\[T\\]\\) [Remove](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L145\u003e)\n\n```go\nfunc (l *List[T]) Remove(e *ListElement[T]) (t T)\n```\n\nRemove removes a given value from the List.\n\n### func \\(\\*List\\[T\\]\\) [SortBy](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L155\u003e)\n\n```go\nfunc (l *List[T]) SortBy(order genfuncs.BiFunction[T, T, bool]) (result *List[T])\n```\n\nSortBy sorts the List by the order of the order function. This is not a pure function, the List is sorted, the List returned is to allow for fluid call chains. List does not provide efficient indexed access so a Bubble sort is employed.\n\n### func \\(\\*List\\[T\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L162\u003e)\n\n```go\nfunc (l *List[T]) Values() (values GSlice[T])\n```\n\nValues returns the values in the list as a GSlice.\n\n## type [ListElement](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L32-L36\u003e)\n\nListElement is an element of List.\n\n```go\ntype ListElement[T any] struct {\n    Value T\n    // contains filtered or unexported fields\n}\n```\n\n### func \\(\\*ListElement\\[T\\]\\) [Next](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L48\u003e)\n\n```go\nfunc (e *ListElement[T]) Next() (next *ListElement[T])\n```\n\nNext returns the next list element or nil.\n\n### func \\(\\*ListElement\\[T\\]\\) [Prev](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L57\u003e)\n\n```go\nfunc (e *ListElement[T]) Prev() (prev *ListElement[T])\n```\n\nPrev returns the previous list element or nil.\n\n### func \\(\\*ListElement\\[T\\]\\) [Swap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/list.go#L66\u003e)\n\n```go\nfunc (e *ListElement[T]) Swap(e2 *ListElement[T])\n```\n\nSwap the values of two ListElements.\n\n## type [Map](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map.go#L20-L29\u003e)\n\nMap interface to provide a polymorphic and generic interface to map implementations.\n\n```go\ntype Map[K comparable, V any] interface {\n    Contains(key K) bool\n    Delete(key K)\n    Get(key K) (value V, ok bool)\n    Put(key K, value V)\n    ForEach(f func(key K, value V))\n    Keys() GSlice[K]\n    // contains filtered or unexported methods\n}\n```\n\n## type [MapSet](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L25-L27\u003e)\n\nMapSet is a Set implementation based on a map. MapSet implements Set.\n\n```go\ntype MapSet[T comparable] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func \\(\\*MapSet\\[T\\]\\) [Add](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L37\u003e)\n\n```go\nfunc (h *MapSet[T]) Add(t T)\n```\n\nAdd element to MapSet.\n\n### func \\(\\*MapSet\\[T\\]\\) [AddAll](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L42\u003e)\n\n```go\nfunc (h *MapSet[T]) AddAll(t ...T)\n```\n\nAddAll elements to MapSet.\n\n### func \\(\\*MapSet\\[T\\]\\) [Contains](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L49\u003e)\n\n```go\nfunc (h *MapSet[T]) Contains(t T) (ok bool)\n```\n\nContains returns true if MapSet contains element.\n\n### func \\(\\*MapSet\\[T\\]\\) [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L55\u003e)\n\n```go\nfunc (h *MapSet[T]) Iterator() Iterator[T]\n```\n\nIterator returns an Iterator of the current state of the MapSet. This creates a copy of the data.\n\n### func \\(\\*MapSet\\[T\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L60\u003e)\n\n```go\nfunc (h *MapSet[T]) Len() (length int)\n```\n\nLen returns the length of the MapSet.\n\n### func \\(\\*MapSet\\[T\\]\\) [Remove](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L66\u003e)\n\n```go\nfunc (h *MapSet[T]) Remove(t T)\n```\n\nRemove an element from the MapSet.\n\n### func \\(\\*MapSet\\[T\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L71\u003e)\n\n```go\nfunc (h *MapSet[T]) Values() (values GSlice[T])\n```\n\nValues returns the elements in the MapSet as a GSlice.\n\n## type [Queue](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/queue.go#L20-L25\u003e)\n\nQueue is a container providing some define order when accessing elements. Queue implements Container.\n\n```go\ntype Queue[T any] interface {\n\n    // Peek returns the next element without removing it.\n    Peek() T\n    Remove() T\n    // contains filtered or unexported methods\n}\n```\n\n## type [Sequence](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/iterator.go#L28-L30\u003e)\n\n```go\ntype Sequence[T any] interface {\n    Iterator() Iterator[T]\n}\n```\n\n### func [NewIteratorSequence](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/iterator.go#L36\u003e)\n\n```go\nfunc NewIteratorSequence[T any](iterator Iterator[T]) Sequence[T]\n```\n\n## type [Set](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/set.go#L20-L27\u003e)\n\nSet is a Container that contains no duplicate elements.\n\n```go\ntype Set[T comparable] interface {\n\n    // Contains returns true if the Set contains a given element.\n    Contains(t T) bool\n    // Remove the element from the Set.\n    Remove(T)\n    // contains filtered or unexported methods\n}\n```\n\n### func [NewMapSet](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/map_set.go#L30\u003e)\n\n```go\nfunc NewMapSet[T comparable](t ...T) (set Set[T])\n```\n\nNewMapSet returns a new Set containing given values.\n\n## type [SyncMap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L27-L29\u003e)\n\nSyncMap is a Map implementation employing sync.Map and is therefore GoRoutine safe.\n\n```go\ntype SyncMap[K any, V any] struct {\n    // contains filtered or unexported fields\n}\n```\n\n### func [NewSyncMap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L32\u003e)\n\n```go\nfunc NewSyncMap[K any, V any]() (syncMap *SyncMap[K, V])\n```\n\nNewSyncMap creates a new SyncMap instance.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Contains](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L38\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Contains(key K) (contains bool)\n```\n\nContains returns true if the Map contains the given key.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Delete](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L44\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Delete(key K)\n```\n\nDelete an entry from the Map.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [ForEach](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L50\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) ForEach(f func(key K, value V))\n```\n\nForEach traverses the Map applying the given function to all entries. The sync.Map's any types are cast to the appropriate types.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Get](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L59\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Get(key K) (value V, ok bool)\n```\n\nGet the value for the key. The sync.Map any type to cast to the appropriate type. The returned ok value will be false if the map is not contained in the Map.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [GetAndDelete](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L69\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) GetAndDelete(key K) (value V, ok bool)\n```\n\nGetAndDelete returns the value from the SyncMap corresponding to the key, returning it, and deletes it.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [GetOrPut](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L80\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) GetOrPut(key K, value V) (actual V, ok bool)\n```\n\nGetOrPut returns the existing value for the key if present. Otherwise, it puts and returns the given value. The ok result is true if the value was present, false if put.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Iterator](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L92\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Iterator() Iterator[V]\n```\n\nIterator returns an iterator over a snapshot of the current values.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Keys](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L98\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Keys() (keys GSlice[K])\n```\n\nKeys returns the keys in the Map by traversing it and casting the sync.Map's any to the appropriate type.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Len](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L107\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Len() (length int)\n```\n\nLen returns the element count. This requires a traversal of the Map.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Put](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L114\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Put(key K, value V)\n```\n\nPut a key value pair into the Map.\n\n### func \\(\\*SyncMap\\[K, V\\]\\) [Values](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sync_map.go#L119\u003e)\n\n```go\nfunc (s *SyncMap[K, V]) Values() (values GSlice[V])\n```\n\nValues returns the values in the Map, The sync.Map any values is cast to the Map's type.\n\n# promises\n\n```go\nimport \"github.com/nwillc/genfuncs/promises\"\n```\n\n## Index\n\n- [Variables](\u003c#variables\u003e)\n- [func All[T any](ctx context.Context, promises ...*genfuncs.Promise[T]) *genfuncs.Promise[container.GSlice[T]]](\u003c#func-all\u003e)\n- [func Any[T any](ctx context.Context, promises ...*genfuncs.Promise[T]) *genfuncs.Promise[T]](\u003c#func-any\u003e)\n- [func Map[A, B any](ctx context.Context, aPromise *genfuncs.Promise[A], then genfuncs.Function[A, *genfuncs.Result[B]]) *genfuncs.Promise[B]](\u003c#func-map\u003e)\n\n\n## Variables\n\n```go\nvar (\n    PromiseAnyNoPromisesErrorMsg = \"no any without promises\"\n    PromiseNoneFulfilled         = \"no promises fulfilled\"\n)\n```\n\n## func [All](\u003chttps://github.com/nwillc/genfuncs/blob/master/promises/promise_functions.go#L39\u003e)\n\n```go\nfunc All[T any](ctx context.Context, promises ...*genfuncs.Promise[T]) *genfuncs.Promise[container.GSlice[T]]\n```\n\nAll accepts promises and collects their results, returning a container.GSlice of the results in correlating order, or if \\*any\\* genfuncs.Promise fails then All returns its error and immediately returns.\n\n## func [Any](\u003chttps://github.com/nwillc/genfuncs/blob/master/promises/promise_functions.go#L70\u003e)\n\n```go\nfunc Any[T any](ctx context.Context, promises ...*genfuncs.Promise[T]) *genfuncs.Promise[T]\n```\n\nAny returns a Promise that will return the first Promise fulfilled, or an error if none were.\n\n## func [Map](\u003chttps://github.com/nwillc/genfuncs/blob/master/promises/promise_functions.go#L99\u003e)\n\n```go\nfunc Map[A, B any](ctx context.Context, aPromise *genfuncs.Promise[A], then genfuncs.Function[A, *genfuncs.Result[B]]) *genfuncs.Promise[B]\n```\n\nMap will Wait for aPromise and then return a new Promise which then maps its result.\n\n# results\n\n```go\nimport \"github.com/nwillc/genfuncs/results\"\n```\n\n## Index\n\n- [func Map[T, R any](t *genfuncs.Result[T], transform genfuncs.Function[T, *genfuncs.Result[R]]) (r *genfuncs.Result[R])](\u003c#func-map\u003e)\n- [func MapError[T, R any](t *genfuncs.Result[T]) (r *genfuncs.Result[R])](\u003c#func-maperror\u003e)\n\n\n## func [Map](\u003chttps://github.com/nwillc/genfuncs/blob/master/results/result_functions.go#L24\u003e)\n\n```go\nfunc Map[T, R any](t *genfuncs.Result[T], transform genfuncs.Function[T, *genfuncs.Result[R]]) (r *genfuncs.Result[R])\n```\n\nMap one Result type to another employing a transform.\n\n## func [MapError](\u003chttps://github.com/nwillc/genfuncs/blob/master/results/result_functions.go#L34\u003e)\n\n```go\nfunc MapError[T, R any](t *genfuncs.Result[T]) (r *genfuncs.Result[R])\n```\n\nMapError Result of one type to another.\n\n# gslices\n\n```go\nimport \"github.com/nwillc/genfuncs/container/gslices\"\n```\n\n## Index\n\n- [func Distinct[T comparable](slice container.GSlice[T]) (distinct container.GSlice[T])](\u003c#func-distinct\u003e)\n- [func FlatMap[T, R any](slice container.GSlice[T], transform genfuncs.Function[T, container.GSlice[R]]) (result container.GSlice[R])](\u003c#func-flatmap\u003e)\n- [func GroupBy[T any, K comparable](slice container.GSlice[T], keyFor maps.KeyFor[T, K]) (result container.GMap[K, container.GSlice[T]])](\u003c#func-groupby\u003e)\n- [func Map[T, R any](slice container.GSlice[T], transform genfuncs.Function[T, R]) container.GSlice[R]](\u003c#func-map\u003e)\n- [func ToSet[T comparable](slice container.GSlice[T]) (set container.Set[T])](\u003c#func-toset\u003e)\n\n\n## func [Distinct](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslices/gslice_functions.go#L26\u003e)\n\n```go\nfunc Distinct[T comparable](slice container.GSlice[T]) (distinct container.GSlice[T])\n```\n\nDistinct returns a slice containing only distinct elements from the given slice.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs/container/gslices\"\n)\n\nfunc main() {\n\tvalues := []int{1, 2, 2, 3, 1, 3}\n\tgslices.Distinct(values).ForEach(func(_, i int) {\n\t\tfmt.Println(i)\n\t})\n}\n```\n\n#### Output\n\n```\n1\n2\n3\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [FlatMap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslices/gslice_functions.go#L33\u003e)\n\n```go\nfunc FlatMap[T, R any](slice container.GSlice[T], transform genfuncs.Function[T, container.GSlice[R]]) (result container.GSlice[R])\n```\n\nFlatMap returns a slice of all elements from results of transform being invoked on each element of original slice, and those resultant slices concatenated.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n\t\"github.com/nwillc/genfuncs/container/gslices\"\n\t\"strings\"\n)\n\nvar words container.GSlice[string] = []string{\"hello\", \"world\"}\n\nfunc main() {\n\tslicer := func(s string) container.GSlice[string] { return strings.Split(s, \"\") }\n\tfmt.Println(gslices.FlatMap(words.SortBy(genfuncs.OrderedLess[string]), slicer))\n}\n```\n\n#### Output\n\n```\n[h e l l o w o r l d]\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [GroupBy](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslices/gslice_functions.go#L43\u003e)\n\n```go\nfunc GroupBy[T any, K comparable](slice container.GSlice[T], keyFor maps.KeyFor[T, K]) (result container.GMap[K, container.GSlice[T]])\n```\n\nGroupBy groups elements of the slice by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a slice of corresponding elements.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container/gslices\"\n)\n\nfunc main() {\n\toddEven := func(i int) *genfuncs.Result[string] {\n\t\tif i%2 == 0 {\n\t\t\treturn genfuncs.NewResult(\"EVEN\")\n\t\t}\n\t\treturn genfuncs.NewResult(\"ODD\")\n\t}\n\tnumbers := []int{1, 2, 3, 4}\n\tgrouped := gslices.GroupBy(numbers, oddEven)\n\tfmt.Println(grouped[\"ODD\"])\n}\n```\n\n#### Output\n\n```\n[1 3]\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [Map](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslices/gslice_functions.go#L59\u003e)\n\n```go\nfunc Map[T, R any](slice container.GSlice[T], transform genfuncs.Function[T, R]) container.GSlice[R]\n```\n\nMap returns a new container.GSlice containing the results of applying the given transform function to each element in the original slice.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs/container/gslices\"\n)\n\nfunc main() {\n\tnumbers := []int{69, 88, 65, 77, 80, 76, 69}\n\ttoString := func(i int) string { return string(rune(i)) }\n\tfmt.Println(gslices.Map(numbers, toString))\n}\n```\n\n#### Output\n\n```\n[E X A M P L E]\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [ToSet](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/gslices/gslice_functions.go#L69\u003e)\n\n```go\nfunc ToSet[T comparable](slice container.GSlice[T]) (set container.Set[T])\n```\n\nToSet creates a Set from the elements of the GSlice.\n\n# maps\n\n```go\nimport \"github.com/nwillc/genfuncs/container/maps\"\n```\n\n## Index\n\n- [func Map[K comparable, V any, R any](m container.Map[K, V], transform genfuncs.BiFunction[K, V, R]) (result container.GSlice[R])](\u003c#func-map\u003e)\n- [func Merge[K comparable, V any](mv ...container.Map[K, container.GSlice[V]]) (result container.GMap[K, container.GSlice[V]])](\u003c#func-merge\u003e)\n- [type Entry](\u003c#type-entry\u003e)\n  - [func NewEntry[K comparable, V any](k K, v V) *Entry[K, V]](\u003c#func-newentry\u003e)\n- [type KeyFor](\u003c#type-keyfor\u003e)\n- [type KeyValueFor](\u003c#type-keyvaluefor\u003e)\n- [type ValueFor](\u003c#type-valuefor\u003e)\n\n\n## func [Map](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_functiions.go#L25\u003e)\n\n```go\nfunc Map[K comparable, V any, R any](m container.Map[K, V], transform genfuncs.BiFunction[K, V, R]) (result container.GSlice[R])\n```\n\nMap returns a GSlice containing the results of applying the given transform function to each element in the GMap.\n\n## func [Merge](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_functiions.go#L36\u003e)\n\n```go\nfunc Merge[K comparable, V any](mv ...container.Map[K, container.GSlice[V]]) (result container.GMap[K, container.GSlice[V]])\n```\n\nMerge merges maps of container.GSlice's together into a new map appending the container.GSlice's when collisions occur.\n\n## type [Entry](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_types.go#L23-L26\u003e)\n\nEntry can be used to hold onto a key/value.\n\n```go\ntype Entry[K comparable, V any] struct {\n    Key   K\n    Value V\n}\n```\n\n### func [NewEntry](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_functiions.go#L47\u003e)\n\n```go\nfunc NewEntry[K comparable, V any](k K, v V) *Entry[K, V]\n```\n\n## type [KeyFor](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_types.go#L29\u003e)\n\nKeyFor is used for generating keys from types, it accepts any type and returns a comparable key for it.\n\n```go\ntype KeyFor[T any, K comparable] func(T) *genfuncs.Result[K]\n```\n\n## type [KeyValueFor](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_types.go#L33\u003e)\n\nKeyValueFor is used to generate a key and value from a type, it accepts any type, and returns a comparable key and any value.\n\n```go\ntype KeyValueFor[T any, K comparable, V any] func(T) *genfuncs.Result[*Entry[K, V]]\n```\n\n## type [ValueFor](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/maps/map_types.go#L36\u003e)\n\nValueFor given a comparable key will return a value for it.\n\n```go\ntype ValueFor[K comparable, T any] func(K) *genfuncs.Result[T]\n```\n\n# sequences\n\n```go\nimport \"github.com/nwillc/genfuncs/container/sequences\"\n```\n\n## Index\n\n- [func All[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) (result bool)](\u003c#func-all\u003e)\n- [func Any[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) (result bool)](\u003c#func-any\u003e)\n- [func Associate[T any, K comparable, V any](sequence container.Sequence[T], keyValueFor maps.KeyValueFor[T, K, V]) (result *genfuncs.Result[container.GMap[K, V]])](\u003c#func-associate\u003e)\n- [func AssociateWith[K comparable, V any](sequence container.Sequence[K], valueFor maps.ValueFor[K, V]) (result *genfuncs.Result[container.GMap[K, V]])](\u003c#func-associatewith\u003e)\n- [func Collect[T any](s container.Sequence[T], c container.Container[T])](\u003c#func-collect\u003e)\n- [func Compare[T any](s1, s2 container.Sequence[T], comparator func(t1, t2 T) int) int](\u003c#func-compare\u003e)\n- [func Distinct[T comparable](s container.Sequence[T]) container.Sequence[T]](\u003c#func-distinct\u003e)\n- [func Find[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) *genfuncs.Result[T]](\u003c#func-find\u003e)\n- [func FindLast[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) *genfuncs.Result[T]](\u003c#func-findlast\u003e)\n- [func FlatMap[T, R any](sequence container.Sequence[T], transform genfuncs.Function[T, container.Sequence[R]]) (result container.Sequence[R])](\u003c#func-flatmap\u003e)\n- [func Fold[T, R any](sequence container.Sequence[T], initial R, operation genfuncs.BiFunction[R, T, R]) (result R)](\u003c#func-fold\u003e)\n- [func ForEach[T any](sequence container.Sequence[T], action func(t T))](\u003c#func-foreach\u003e)\n- [func IsSorted[T any](sequence container.Sequence[T], order genfuncs.BiFunction[T, T, bool]) (ok bool)](\u003c#func-issorted\u003e)\n- [func JoinToString[T any](sequence container.Sequence[T], stringer genfuncs.ToString[T], separator string, prefix string, postfix string) string](\u003c#func-jointostring\u003e)\n- [func Map[T, R any](sequence container.Sequence[T], transform genfuncs.Function[T, R]) container.Sequence[R]](\u003c#func-map\u003e)\n- [func NewSequence[T any](values ...T) (sequence container.Sequence[T])](\u003c#func-newsequence\u003e)\n\n\n## func [All](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L28\u003e)\n\n```go\nfunc All[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) (result bool)\n```\n\nAll returns true if all elements in the sequence match the predicate.\n\n## func [Any](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L41\u003e)\n\n```go\nfunc Any[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) (result bool)\n```\n\nAny returns true if any element of the sequence matches the predicate.\n\n## func [Associate](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L55\u003e)\n\n```go\nfunc Associate[T any, K comparable, V any](sequence container.Sequence[T], keyValueFor maps.KeyValueFor[T, K, V]) (result *genfuncs.Result[container.GMap[K, V]])\n```\n\nAssociate returns a map containing key/values created by applying a function to each value of the container.Iterator returned by the container.Sequence.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n\t\"github.com/nwillc/genfuncs/container/maps\"\n\t\"github.com/nwillc/genfuncs/container/sequences\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbyLastName := func(n string) *genfuncs.Result[*maps.Entry[string, string]] {\n\t\tparts := strings.Split(n, \" \")\n\t\treturn genfuncs.NewResult(maps.NewEntry(parts[1], n))\n\t}\n\tnames := sequences.NewSequence[string](\"fred flintstone\", \"barney rubble\")\n\tsequences.Associate(names, byLastName).\n\t\tOnSuccess(func(nameMap container.GMap[string, string]) {\n\t\t\tfmt.Println(nameMap[\"rubble\"])\n\t\t})\n\n}\n```\n\n#### Output\n\n```\nbarney rubble\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [AssociateWith](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L70\u003e)\n\n```go\nfunc AssociateWith[K comparable, V any](sequence container.Sequence[K], valueFor maps.ValueFor[K, V]) (result *genfuncs.Result[container.GMap[K, V]])\n```\n\nAssociateWith returns a Map where keys are elements from the given sequence and values are produced by the valueSelector function applied to each element.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs\"\n\t\"github.com/nwillc/genfuncs/container\"\n\t\"github.com/nwillc/genfuncs/container/sequences\"\n)\n\nfunc main() {\n\toddEven := func(i int) *genfuncs.Result[string] {\n\t\tif i%2 == 0 {\n\t\t\treturn genfuncs.NewResult(\"EVEN\")\n\t\t}\n\t\treturn genfuncs.NewResult(\"ODD\")\n\t}\n\tnumbers := sequences.NewSequence[int](1, 2, 3, 4)\n\tsequences.AssociateWith[int, string](numbers, oddEven).OnSuccess(func(odsEvensMap container.GMap[int, string]) {\n\t\tfmt.Println(odsEvensMap[2])\n\t\tfmt.Println(odsEvensMap[3])\n\t})\n}\n```\n\n#### Output\n\n```\nEVEN\nODD\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [Collect](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L86\u003e)\n\n```go\nfunc Collect[T any](s container.Sequence[T], c container.Container[T])\n```\n\nCollect elements from a Sequence into a Container.\n\n## func [Compare](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L94\u003e)\n\n```go\nfunc Compare[T any](s1, s2 container.Sequence[T], comparator func(t1, t2 T) int) int\n```\n\nCompare two sequences with a comparator returning less/equal/greater \\(\\-1/0/1\\) and return comparison of the two.\n\n## func [Distinct](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L113\u003e)\n\n```go\nfunc Distinct[T comparable](s container.Sequence[T]) container.Sequence[T]\n```\n\nDistinct collects a sequence into a container.Set and returns it as a Sequence.\n\n## func [Find](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L120\u003e)\n\n```go\nfunc Find[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) *genfuncs.Result[T]\n```\n\nFind returns the first element matching the given predicate, or Result error of NoSuchElement if not found.\n\n## func [FindLast](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L133\u003e)\n\n```go\nfunc FindLast[T any](sequence container.Sequence[T], predicate genfuncs.Function[T, bool]) *genfuncs.Result[T]\n```\n\nFindLast returns the last element matching the given predicate, or Result error of NoSuchElement if not found.\n\n## func [FlatMap](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L148\u003e)\n\n```go\nfunc FlatMap[T, R any](sequence container.Sequence[T], transform genfuncs.Function[T, container.Sequence[R]]) (result container.Sequence[R])\n```\n\nFlatMap returns a sequence of all elements from results of valueFor being invoked on each element of original sequence, and those resultant slices concatenated.\n\n## func [Fold](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L154\u003e)\n\n```go\nfunc Fold[T, R any](sequence container.Sequence[T], initial R, operation genfuncs.BiFunction[R, T, R]) (result R)\n```\n\nFold accumulates a value starting with an initial value and applying operation to each value of the container.Iterator returned by the container.Sequence.\n\n\u003cdetails\u003e\u003csummary\u003eExample\u003c/summary\u003e\n\u003cp\u003e\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/nwillc/genfuncs/container/sequences\"\n)\n\nfunc main() {\n\tsequence := sequences.NewSequence(1, 2, 3, 4)\n\tsum := sequences.Fold(sequence, 0, func(prior, value int) int {\n\t\treturn prior + value\n\t})\n\tfmt.Println(sum)\n}\n```\n\n#### Output\n\n```\n10\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## func [ForEach](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L164\u003e)\n\n```go\nfunc ForEach[T any](sequence container.Sequence[T], action func(t T))\n```\n\nForEach calls action for each element of a Sequence.\n\n## func [IsSorted](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L172\u003e)\n\n```go\nfunc IsSorted[T any](sequence container.Sequence[T], order genfuncs.BiFunction[T, T, bool]) (ok bool)\n```\n\nIsSorted returns true if the GSlice is sorted by order.\n\n## func [JoinToString](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L194-L200\u003e)\n\n```go\nfunc JoinToString[T any](sequence container.Sequence[T], stringer genfuncs.ToString[T], separator string, prefix string, postfix string) string\n```\n\nJoinToString creates a string from all the elements of a Sequence using the stringer on each, separating them using separator, and using the given prefix and postfix.\n\n## func [Map](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L218\u003e)\n\n```go\nfunc Map[T, R any](sequence container.Sequence[T], transform genfuncs.Function[T, R]) container.Sequence[R]\n```\n\nMap elements in a Sequence to a new Sequence having applied the valueFor to them.\n\n## func [NewSequence](\u003chttps://github.com/nwillc/genfuncs/blob/master/container/sequences/sequence_functions.go#L223\u003e)\n\n```go\nfunc NewSequence[T any](values ...T) (sequence container.Sequence[T])\n```\n\nNewSequence creates a sequence from the provided values.\n\n# version\n\n```go\nimport \"github.com/nwillc/genfuncs/gen/version\"\n```\n\n## Index\n\n- [Constants](\u003c#constants\u003e)\n\n\n## Constants\n\nVersion number for official releases.\n\n```go\nconst Version = \"v0.20.0\"\n```\n\n# tests\n\n```go\nimport \"github.com/nwillc/genfuncs/internal/tests\"\n```\n\n## Index\n\n- [Constants](\u003c#constants\u003e)\n- [func MaybeRunExamples(t *testing.T)](\u003c#func-mayberunexamples\u003e)\n\n\n## Constants\n\n```go\nconst RunExamples = \"RUN_EXAMPLES\"\n```\n\n## func [MaybeRunExamples](\u003chttps://github.com/nwillc/genfuncs/blob/master/internal/tests/example_toggle.go#L26\u003e)\n\n```go\nfunc MaybeRunExamples(t *testing.T)\n```\n\n\n\nGenerated by [gomarkdoc](\u003chttps://github.com/princjef/gomarkdoc\u003e)\n","funding_links":[],"categories":["Data Structures and Algorithms","数据结构与算法","Data Integration Frameworks","Generators"],"sub_categories":["Miscellaneous Data Structures and Algorithms","杂项数据结构和算法"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwillc%2Fgenfuncs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwillc%2Fgenfuncs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwillc%2Fgenfuncs/lists"}