Full Code of samber/lo for AI

master 4d1dbfadf753 cached
650 files
2.2 MB
596.9k tokens
2669 symbols
1 requests
Download .txt
Showing preview only (2,374K chars total). Download the full file or copy to clipboard to get everything.
Repository: samber/lo
Branch: master
Commit: 4d1dbfadf753
Files: 650
Total size: 2.2 MB

Directory structure:
gitextract_vboab2u1/

├── .github/
│   ├── FUNDING.yml
│   ├── PULL_REQUEST_TEMPLATE/
│   │   ├── config.yml
│   │   ├── new_helper.md
│   │   └── other.md
│   ├── dependabot.yml
│   └── workflows/
│       ├── doc.yml
│       ├── lint.yml
│       ├── release.yml
│       ├── test.simd.yml
│       └── test.yml
├── .gitignore
├── .golangci.yml
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── benchmark/
│   ├── CLAUDE.md
│   ├── core_condition_bench_test.go
│   ├── core_find_bench_test.go
│   ├── core_intersect_bench_test.go
│   ├── core_map_bench_test.go
│   ├── core_math_bench_test.go
│   ├── core_slice_bench_test.go
│   ├── core_string_bench_test.go
│   ├── core_tuples_bench_test.go
│   ├── core_type_manipulation_bench_test.go
│   ├── helpers_test.go
│   ├── it_find_bench_test.go
│   ├── it_helpers_test.go
│   ├── it_map_bench_test.go
│   ├── it_math_bench_test.go
│   ├── it_slice_bench_test.go
│   ├── it_type_manipulation_bench_test.go
│   ├── mutable_slice_bench_test.go
│   └── parallel_slice_bench_test.go
├── channel.go
├── channel_test.go
├── concurrency.go
├── concurrency_test.go
├── condition.go
├── condition_test.go
├── constraints.go
├── docs/
│   ├── .gitignore
│   ├── CLAUDE.md
│   ├── README.md
│   ├── data/
│   │   ├── core-assert.md
│   │   ├── core-assign.md
│   │   ├── core-associate.md
│   │   ├── core-asyncx.md
│   │   ├── core-attempt.md
│   │   ├── core-attemptwhile.md
│   │   ├── core-attemptwhilewithdelay.md
│   │   ├── core-attemptwithdelay.md
│   │   ├── core-buffer.md
│   │   ├── core-bufferwithtimeout.md
│   │   ├── core-camelcase.md
│   │   ├── core-capitalize.md
│   │   ├── core-channeldispatcher.md
│   │   ├── core-channeltoslice.md
│   │   ├── core-chunk.md
│   │   ├── core-chunkentries.md
│   │   ├── core-chunkstring.md
│   │   ├── core-clamp.md
│   │   ├── core-clone.md
│   │   ├── core-coalesce.md
│   │   ├── core-coalescemap.md
│   │   ├── core-coalescemaporempty.md
│   │   ├── core-coalesceorempty.md
│   │   ├── core-coalesceslice.md
│   │   ├── core-coalescesliceorempty.md
│   │   ├── core-compact.md
│   │   ├── core-concat.md
│   │   ├── core-contains.md
│   │   ├── core-containsby.md
│   │   ├── core-count.md
│   │   ├── core-countby.md
│   │   ├── core-countbyerr.md
│   │   ├── core-countvalues.md
│   │   ├── core-countvaluesby.md
│   │   ├── core-crossjoinbyerrx.md
│   │   ├── core-crossjoinbyx.md
│   │   ├── core-crossjoinx.md
│   │   ├── core-cut.md
│   │   ├── core-cutprefix.md
│   │   ├── core-cutsuffix.md
│   │   ├── core-difference.md
│   │   ├── core-dispatchingstrategy.md
│   │   ├── core-drop.md
│   │   ├── core-dropbyindex.md
│   │   ├── core-dropright.md
│   │   ├── core-droprightwhile.md
│   │   ├── core-dropwhile.md
│   │   ├── core-durationx.md
│   │   ├── core-earliest.md
│   │   ├── core-earliestby.md
│   │   ├── core-earliestbyerr.md
│   │   ├── core-elementsmatch.md
│   │   ├── core-elementsmatchby.md
│   │   ├── core-ellipsis.md
│   │   ├── core-empty.md
│   │   ├── core-emptyabletoptr.md
│   │   ├── core-entries.md
│   │   ├── core-errorsas.md
│   │   ├── core-every.md
│   │   ├── core-everyby.md
│   │   ├── core-fanin.md
│   │   ├── core-fanout.md
│   │   ├── core-fill.md
│   │   ├── core-filter.md
│   │   ├── core-filtererr.md
│   │   ├── core-filterkeys.md
│   │   ├── core-filterkeyserr.md
│   │   ├── core-filtermap.md
│   │   ├── core-filtermaptoslice.md
│   │   ├── core-filtermaptosliceerr.md
│   │   ├── core-filterreject.md
│   │   ├── core-filterslicetomap.md
│   │   ├── core-filtervalues.md
│   │   ├── core-filtervalueserr.md
│   │   ├── core-find.md
│   │   ├── core-findduplicates.md
│   │   ├── core-findduplicatesby.md
│   │   ├── core-findduplicatesbyerr.md
│   │   ├── core-finderr.md
│   │   ├── core-findindexof.md
│   │   ├── core-findkey.md
│   │   ├── core-findkeyby.md
│   │   ├── core-findlastindexof.md
│   │   ├── core-findorelse.md
│   │   ├── core-finduniques.md
│   │   ├── core-finduniquesby.md
│   │   ├── core-first.md
│   │   ├── core-firstor.md
│   │   ├── core-firstorempty.md
│   │   ├── core-flatmap.md
│   │   ├── core-flatmaperr.md
│   │   ├── core-flatten.md
│   │   ├── core-foreach.md
│   │   ├── core-foreachwhile.md
│   │   ├── core-fromanyslice.md
│   │   ├── core-fromentries.md
│   │   ├── core-frompairs.md
│   │   ├── core-fromptr.md
│   │   ├── core-fromptror.md
│   │   ├── core-fromsliceptr.md
│   │   ├── core-generator.md
│   │   ├── core-groupby.md
│   │   ├── core-groupbyerr.md
│   │   ├── core-groupbymap.md
│   │   ├── core-groupbymaperr.md
│   │   ├── core-haskey.md
│   │   ├── core-hasprefix.md
│   │   ├── core-hassuffix.md
│   │   ├── core-if.md
│   │   ├── core-indexof.md
│   │   ├── core-interleave.md
│   │   ├── core-intersect.md
│   │   ├── core-intersectby.md
│   │   ├── core-invert.md
│   │   ├── core-isempty.md
│   │   ├── core-isnil.md
│   │   ├── core-isnotempty.md
│   │   ├── core-isnotnil.md
│   │   ├── core-issorted.md
│   │   ├── core-issortedby.md
│   │   ├── core-kebabcase.md
│   │   ├── core-keyby.md
│   │   ├── core-keybyerr.md
│   │   ├── core-keyify.md
│   │   ├── core-keys.md
│   │   ├── core-last.md
│   │   ├── core-lastindexof.md
│   │   ├── core-lastor.md
│   │   ├── core-lastorempty.md
│   │   ├── core-latest.md
│   │   ├── core-latestby.md
│   │   ├── core-latestbyerr.md
│   │   ├── core-map.md
│   │   ├── core-mapentries.md
│   │   ├── core-mapentrieserr.md
│   │   ├── core-maperr.md
│   │   ├── core-mapkeys.md
│   │   ├── core-mapkeyserr.md
│   │   ├── core-maptoslice.md
│   │   ├── core-maptosliceerr.md
│   │   ├── core-mapvalues.md
│   │   ├── core-mapvalueserr.md
│   │   ├── core-max.md
│   │   ├── core-maxby.md
│   │   ├── core-maxbyerr.md
│   │   ├── core-maxindex.md
│   │   ├── core-maxindexby.md
│   │   ├── core-maxindexbyerr.md
│   │   ├── core-mean.md
│   │   ├── core-meanby.md
│   │   ├── core-meanbyerr.md
│   │   ├── core-min.md
│   │   ├── core-minby.md
│   │   ├── core-minbyerr.md
│   │   ├── core-minindex.md
│   │   ├── core-minindexby.md
│   │   ├── core-minindexbyerr.md
│   │   ├── core-mode.md
│   │   ├── core-mustx.md
│   │   ├── core-newdebounce.md
│   │   ├── core-newdebounceby.md
│   │   ├── core-newthrottle.md
│   │   ├── core-newthrottleby.md
│   │   ├── core-newthrottlebywithcount.md
│   │   ├── core-newthrottlewithcount.md
│   │   ├── core-newtransaction.md
│   │   ├── core-nil.md
│   │   ├── core-none.md
│   │   ├── core-noneby.md
│   │   ├── core-nth.md
│   │   ├── core-nthor.md
│   │   ├── core-nthorempty.md
│   │   ├── core-omitby.md
│   │   ├── core-omitbyerr.md
│   │   ├── core-omitbykeys.md
│   │   ├── core-omitbyvalues.md
│   │   ├── core-partialx.md
│   │   ├── core-partitionby.md
│   │   ├── core-partitionbyerr.md
│   │   ├── core-pascalcase.md
│   │   ├── core-pickby.md
│   │   ├── core-pickbyerr.md
│   │   ├── core-pickbykeys.md
│   │   ├── core-pickbyvalues.md
│   │   ├── core-product.md
│   │   ├── core-productby.md
│   │   ├── core-productbyerr.md
│   │   ├── core-randomstring.md
│   │   ├── core-range.md
│   │   ├── core-rangefrom.md
│   │   ├── core-rangewithsteps.md
│   │   ├── core-reduce.md
│   │   ├── core-reduceerr.md
│   │   ├── core-reduceright.md
│   │   ├── core-reducerighterr.md
│   │   ├── core-reject.md
│   │   ├── core-rejecterr.md
│   │   ├── core-rejectmap.md
│   │   ├── core-repeat.md
│   │   ├── core-repeatby.md
│   │   ├── core-repeatbyerr.md
│   │   ├── core-replace.md
│   │   ├── core-replaceall.md
│   │   ├── core-reverse.md
│   │   ├── core-runelength.md
│   │   ├── core-sample.md
│   │   ├── core-sampleby.md
│   │   ├── core-samples.md
│   │   ├── core-samplesby.md
│   │   ├── core-shuffle.md
│   │   ├── core-slice.md
│   │   ├── core-slicetochannel.md
│   │   ├── core-slicetomap.md
│   │   ├── core-sliding.md
│   │   ├── core-snakecase.md
│   │   ├── core-some.md
│   │   ├── core-someby.md
│   │   ├── core-splice.md
│   │   ├── core-subset.md
│   │   ├── core-substring.md
│   │   ├── core-sum.md
│   │   ├── core-sumby.md
│   │   ├── core-sumbyerr.md
│   │   ├── core-switch.md
│   │   ├── core-synchronize.md
│   │   ├── core-take.md
│   │   ├── core-takefilter.md
│   │   ├── core-takewhile.md
│   │   ├── core-ternary.md
│   │   ├── core-times.md
│   │   ├── core-toanyslice.md
│   │   ├── core-topairs.md
│   │   ├── core-toptr.md
│   │   ├── core-tosliceptr.md
│   │   ├── core-trim.md
│   │   ├── core-trimleft.md
│   │   ├── core-trimprefix.md
│   │   ├── core-trimright.md
│   │   ├── core-trimsuffix.md
│   │   ├── core-trycatch.md
│   │   ├── core-trycatchwitherrorvalue.md
│   │   ├── core-tryorx.md
│   │   ├── core-trywitherrorvalue.md
│   │   ├── core-tryx.md
│   │   ├── core-tuplex.md
│   │   ├── core-union.md
│   │   ├── core-uniq.md
│   │   ├── core-uniqby.md
│   │   ├── core-uniqbyerr.md
│   │   ├── core-uniqkeys.md
│   │   ├── core-uniqmap.md
│   │   ├── core-uniqvalues.md
│   │   ├── core-unpackx.md
│   │   ├── core-unzipbyerrx.md
│   │   ├── core-unzipbyx.md
│   │   ├── core-unzipx.md
│   │   ├── core-validate.md
│   │   ├── core-valueor.md
│   │   ├── core-values.md
│   │   ├── core-waitfor.md
│   │   ├── core-window.md
│   │   ├── core-without.md
│   │   ├── core-withoutby.md
│   │   ├── core-withoutbyerr.md
│   │   ├── core-withoutempty.md
│   │   ├── core-withoutnth.md
│   │   ├── core-words.md
│   │   ├── core-zipbyerrx.md
│   │   ├── core-zipbyx.md
│   │   ├── core-zipx.md
│   │   ├── it-assign.md
│   │   ├── it-associate.md
│   │   ├── it-buffer.md
│   │   ├── it-channelseq.md
│   │   ├── it-channeltoseq.md
│   │   ├── it-chunk.md
│   │   ├── it-chunkentries.md
│   │   ├── it-chunkstring.md
│   │   ├── it-coalesceseq.md
│   │   ├── it-coalesceseqorempty.md
│   │   ├── it-compact.md
│   │   ├── it-concat.md
│   │   ├── it-contains.md
│   │   ├── it-containsby.md
│   │   ├── it-count.md
│   │   ├── it-countby.md
│   │   ├── it-countvalues.md
│   │   ├── it-countvaluesby.md
│   │   ├── it-crossjoinbyx.md
│   │   ├── it-crossjoinx.md
│   │   ├── it-cutprefix.md
│   │   ├── it-cutsuffix.md
│   │   ├── it-drain.md
│   │   ├── it-drop.md
│   │   ├── it-dropbyindex.md
│   │   ├── it-droplast.md
│   │   ├── it-droplastwhile.md
│   │   ├── it-dropslice.md
│   │   ├── it-dropwhile.md
│   │   ├── it-earliest.md
│   │   ├── it-earliestby.md
│   │   ├── it-elementsmatch.md
│   │   ├── it-elementsmatchby.md
│   │   ├── it-empty.md
│   │   ├── it-entries.md
│   │   ├── it-every.md
│   │   ├── it-everyby.md
│   │   ├── it-fill.md
│   │   ├── it-filter.md
│   │   ├── it-filterkeys.md
│   │   ├── it-filtermap.md
│   │   ├── it-filtermaptoseq.md
│   │   ├── it-filtervalues.md
│   │   ├── it-find.md
│   │   ├── it-findduplicates.md
│   │   ├── it-findduplicatesby.md
│   │   ├── it-findindexof.md
│   │   ├── it-findlastindexof.md
│   │   ├── it-findorelse.md
│   │   ├── it-finduniques.md
│   │   ├── it-finduniquesby.md
│   │   ├── it-first.md
│   │   ├── it-firstor.md
│   │   ├── it-firstorempty.md
│   │   ├── it-flatmap.md
│   │   ├── it-flatten.md
│   │   ├── it-foreach.md
│   │   ├── it-foreachwhile.md
│   │   ├── it-fromanyseq.md
│   │   ├── it-fromentries.md
│   │   ├── it-frompairs.md
│   │   ├── it-fromseqptr.md
│   │   ├── it-fromseqptror.md
│   │   ├── it-groupby.md
│   │   ├── it-hasprefix.md
│   │   ├── it-hassuffix.md
│   │   ├── it-indexof.md
│   │   ├── it-interleave.md
│   │   ├── it-intersect.md
│   │   ├── it-intersectby.md
│   │   ├── it-invert.md
│   │   ├── it-isempty.md
│   │   ├── it-isnotempty.md
│   │   ├── it-issorted.md
│   │   ├── it-issortedby.md
│   │   ├── it-keyby.md
│   │   ├── it-keyify.md
│   │   ├── it-keys.md
│   │   ├── it-last.md
│   │   ├── it-lastindexof.md
│   │   ├── it-lastor.md
│   │   ├── it-lastorempty.md
│   │   ├── it-latest.md
│   │   ├── it-latestby.md
│   │   ├── it-length.md
│   │   ├── it-map.md
│   │   ├── it-maptoseq.md
│   │   ├── it-max.md
│   │   ├── it-maxby.md
│   │   ├── it-maxindex.md
│   │   ├── it-maxindexby.md
│   │   ├── it-mean.md
│   │   ├── it-meanby.md
│   │   ├── it-min.md
│   │   ├── it-minby.md
│   │   ├── it-minindex.md
│   │   ├── it-minindexby.md
│   │   ├── it-mode.md
│   │   ├── it-none.md
│   │   ├── it-noneby.md
│   │   ├── it-nth.md
│   │   ├── it-nthor.md
│   │   ├── it-nthorempty.md
│   │   ├── it-partitionby.md
│   │   ├── it-product.md
│   │   ├── it-productby.md
│   │   ├── it-range.md
│   │   ├── it-rangefrom.md
│   │   ├── it-rangewithsteps.md
│   │   ├── it-reduce.md
│   │   ├── it-reducelast.md
│   │   ├── it-reject.md
│   │   ├── it-rejectmap.md
│   │   ├── it-repeat.md
│   │   ├── it-repeatby.md
│   │   ├── it-replace.md
│   │   ├── it-replaceall.md
│   │   ├── it-reverse.md
│   │   ├── it-sample.md
│   │   ├── it-sampleby.md
│   │   ├── it-samples.md
│   │   ├── it-samplesby.md
│   │   ├── it-seqtochannel.md
│   │   ├── it-sequencestate.md
│   │   ├── it-shuffle.md
│   │   ├── it-slice.md
│   │   ├── it-sliding.md
│   │   ├── it-some.md
│   │   ├── it-someby.md
│   │   ├── it-splice.md
│   │   ├── it-subset.md
│   │   ├── it-sum.md
│   │   ├── it-sumby.md
│   │   ├── it-take.md
│   │   ├── it-takefilter.md
│   │   ├── it-takewhile.md
│   │   ├── it-times.md
│   │   ├── it-toanyseq.md
│   │   ├── it-toseqptr.md
│   │   ├── it-trim.md
│   │   ├── it-trimfirst.md
│   │   ├── it-trimlast.md
│   │   ├── it-trimprefix.md
│   │   ├── it-trimsuffix.md
│   │   ├── it-union.md
│   │   ├── it-uniq.md
│   │   ├── it-uniqby.md
│   │   ├── it-uniqkeys.md
│   │   ├── it-uniqvalues.md
│   │   ├── it-values.md
│   │   ├── it-window.md
│   │   ├── it-without.md
│   │   ├── it-withoutby.md
│   │   ├── it-withoutnth.md
│   │   ├── it-zipbyx.md
│   │   ├── it-zipx.md
│   │   ├── mutable-fill.md
│   │   ├── mutable-filter.md
│   │   ├── mutable-map.md
│   │   ├── mutable-reverse.md
│   │   ├── mutable-shuffle.md
│   │   ├── parallel-foreach.md
│   │   ├── parallel-groupby.md
│   │   ├── parallel-map.md
│   │   ├── parallel-partitionby.md
│   │   ├── parallel-times.md
│   │   ├── simd-clamp.md
│   │   ├── simd-contains.md
│   │   ├── simd-max.md
│   │   ├── simd-mean.md
│   │   ├── simd-meanby.md
│   │   ├── simd-min.md
│   │   ├── simd-sum.md
│   │   └── simd-sumby.md
│   ├── docs/
│   │   ├── _category_.json
│   │   ├── about.md
│   │   ├── contributing.md
│   │   ├── core/
│   │   │   ├── _category_.json
│   │   │   ├── channel.md
│   │   │   ├── concurrency.md
│   │   │   ├── condition.md
│   │   │   ├── error-handling.md
│   │   │   ├── find.md
│   │   │   ├── function.md
│   │   │   ├── intersect.md
│   │   │   ├── map.md
│   │   │   ├── math.md
│   │   │   ├── retry.md
│   │   │   ├── slice.md
│   │   │   ├── string.md
│   │   │   ├── time.md
│   │   │   ├── tuple.md
│   │   │   └── type.md
│   │   ├── experimental/
│   │   │   ├── _category_.json
│   │   │   └── simd.md
│   │   ├── getting-started.md
│   │   ├── glossary.md
│   │   ├── iter/
│   │   │   ├── _category_.json
│   │   │   ├── channel.md
│   │   │   ├── find.md
│   │   │   ├── intersect.md
│   │   │   ├── map.md
│   │   │   ├── sequence.md
│   │   │   ├── slice.md
│   │   │   ├── string.md
│   │   │   ├── tuple.md
│   │   │   └── type.md
│   │   ├── mutable/
│   │   │   ├── _category_.json
│   │   │   └── slice.md
│   │   └── parallel/
│   │       ├── _category_.json
│   │       └── slice.md
│   ├── docusaurus.config.ts
│   ├── package.json
│   ├── plugins/
│   │   └── helpers-pages/
│   │       ├── components/
│   │       │   ├── HelperCard.tsx
│   │       │   ├── HelperList.tsx
│   │       │   ├── HelperTOC.tsx
│   │       │   ├── helper-components.css
│   │       │   └── highlightPrototypeGenerics.ts
│   │       └── index.ts
│   ├── scripts/
│   │   ├── check-cross-references.js
│   │   ├── check-duplicates-in-category.js
│   │   ├── check-filename-matches-frontmatter.js
│   │   ├── check-function-signatures.js
│   │   ├── check-helpers-visible-in-pages.js
│   │   ├── check-similar-exists.js
│   │   ├── check-similar-keys-exist-in-directory.js
│   │   └── utils.js
│   ├── sidebars.ts
│   ├── src/
│   │   ├── css/
│   │   │   └── custom.css
│   │   ├── pages/
│   │   │   ├── community.module.css
│   │   │   ├── community.tsx
│   │   │   ├── index.module.css
│   │   │   └── index.tsx
│   │   ├── prism-include-languages.js
│   │   └── theme/
│   │       ├── DocSidebar/
│   │       │   └── index.tsx
│   │       ├── NotFound/
│   │       │   └── index.tsx
│   │       └── prism-include-languages.js
│   ├── static/
│   │   ├── .nojekyll
│   │   ├── img/
│   │   │   ├── README.md
│   │   │   ├── logo-full.xcf
│   │   │   └── social-preview.xcf
│   │   └── llms.txt
│   └── tsconfig.json
├── errors.go
├── errors_test.go
├── exp/
│   └── simd/
│       ├── BENCHMARK.md
│       ├── README.md
│       ├── cpu_amd64.go
│       ├── cpu_amd64_test.go
│       ├── go.mod
│       ├── go.sum
│       ├── intersect_avx512.go
│       ├── intersect_avx512_test.go
│       ├── intersect_bench_test.go
│       ├── math.go
│       ├── math_avx.go
│       ├── math_avx2.go
│       ├── math_avx2_test.go
│       ├── math_avx512.go
│       ├── math_avx512_test.go
│       ├── math_avx_test.go
│       ├── math_bench_test.go
│       ├── simd.go
│       ├── simd_test.go
│       └── unsafe.go
├── find.go
├── find_test.go
├── func.go
├── func_test.go
├── go.mod
├── go.sum
├── internal/
│   ├── constraints/
│   │   ├── README.md
│   │   ├── constraints.go
│   │   ├── ordered_go118.go
│   │   └── ordered_go121.go
│   ├── xrand/
│   │   ├── ordered_go118.go
│   │   └── ordered_go122.go
│   └── xtime/
│       ├── README.md
│       ├── fake.go
│       ├── noCopy.go
│       ├── real.go
│       └── time.go
├── intersect.go
├── intersect_test.go
├── it/
│   ├── channel.go
│   ├── channel_test.go
│   ├── find.go
│   ├── find_example_test.go
│   ├── find_test.go
│   ├── intersect.go
│   ├── intersect_example_test.go
│   ├── intersect_test.go
│   ├── lo_test.go
│   ├── map.go
│   ├── map_example_test.go
│   ├── map_test.go
│   ├── math.go
│   ├── math_example_test.go
│   ├── math_test.go
│   ├── seq.go
│   ├── seq_example_test.go
│   ├── seq_test.go
│   ├── string.go
│   ├── string_example_test.go
│   ├── string_test.go
│   ├── tuples.go
│   ├── tuples_example_test.go
│   ├── tuples_test.go
│   ├── type_manipulation.go
│   └── type_manipulation_test.go
├── lo_example_test.go
├── lo_test.go
├── map.go
├── map_test.go
├── math.go
├── math_test.go
├── mutable/
│   ├── slice.go
│   ├── slice_example_test.go
│   └── slice_test.go
├── parallel/
│   ├── slice.go
│   └── slice_test.go
├── retry.go
├── retry_example_test.go
├── retry_test.go
├── slice.go
├── slice_test.go
├── string.go
├── string_test.go
├── time.go
├── time_test.go
├── tuples.go
├── tuples_test.go
├── type_manipulation.go
├── type_manipulation_test.go
└── types.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
github: [samber]


================================================
FILE: .github/PULL_REQUEST_TEMPLATE/config.yml
================================================
template_chooser:
  enabled: true
  default: "other.md"
  choices:
    - name: "New Helper"
      file: "new_helper.md"
    - name: "Other Changes"
      file: "other.md"


================================================
FILE: .github/PULL_REQUEST_TEMPLATE/new_helper.md
================================================

## Describe your changes

...

## Checklist before requesting a review

- [ ] 👓 I have performed a self-review of my code
- [ ] 👶 This helper does not already exist
- [ ] 🧪 This helper is tested
- [ ] 🏎️ My code limits memory allocation and is fast
- [ ] 🧞‍♂️ This helper is immutable and my tests prove it
- [ ] ✍️ I implemented the parallel, iterator and mutable variants
- [ ] 🔬 An example has been added to lo_example_test.go
- [ ] ⛹️ An example has been created on https://go.dev/play and added in comments
- [ ] 📖 My helper has been added to documentation
  - [ ] in README.md
  - [ ] in docs/data/*.md
  - [ ] in docs/static/llms.txt

## Conventions

- Returning `(ok bool)` is often better than `(err error)`
- `panic(...)` must be limited
- Helpers should receive variadic arguments when relevent
- Add variants of your helper when relevant:
  - Variable number of arguments: `lo.Must0`, `lo.Must1`, `lo.Must2`, ...
  - Predicate with index: `lo.SliceToMap` vs `lo.SliceToMapI` 
  - With lazy callback: `lo.Ternary` vs `lo.TernaryF`
  - ...


================================================
FILE: .github/PULL_REQUEST_TEMPLATE/other.md
================================================


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: monthly

  - package-ecosystem: gomod
    directory: /
    schedule:
      interval: weekly

  - package-ecosystem: npm
    directory: /docs
    schedule:
      interval: monthly
    ignore:
      - dependency-name: '*'
        update-types: ["version-update:semver-patch"]
    groups:
      docusaurus:
        patterns:
          - "@docusaurus/*"
      react:
        patterns:
          - "react"
          - "react-dom"

================================================
FILE: .github/workflows/doc.yml
================================================
name: Documentation

on:
  pull_request:
    paths:
      - 'docs/**'
  push:
    paths:
      - 'docs/**'

jobs:
  build-doc:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./docs

    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Setup Node.js
        uses: actions/setup-node@v6

      - name: Install dependencies
        run: npm i

      - name: Build Docusaurus project
        run: npm run build


  # validate-doc:
  #   runs-on: ubuntu-latest
  #   defaults:
  #     run:
  #       working-directory: ./docs

  #   steps:
  #     - name: Checkout repository
  #       uses: actions/checkout@v6

  #     - name: Setup Node.js
  #       uses: actions/setup-node@v6

  #     - name: Install dependencies
  #       run: npm i

  #     - name: Run docs helpers checks
  #       run: |
  #         node docs/scripts/check-duplicates-in-category.js
  #         node docs/scripts/check-similar-exists.js
  #         node docs/scripts/check-filename-matches-frontmatter.js
  #         node docs/scripts/check-similar-keys-exist-in-directory.js
  #         node docs/scripts/check-cross-references.js

  #     - name: Sync function signatures
  #       run: npm run sync:function-signatures
  #     - name: Commit and push changes
  #       uses: stefanzweifel/git-auto-commit-action@v5
  #       with:
  #         commit_message: 'docs: sync function signatures from source'
  #         commit_user_name: github-actions[bot]
  #         commit_user_email: github-actions[bot]@users.noreply.github.com
  #         file_pattern: docs/data/*.md

================================================
FILE: .github/workflows/lint.yml
================================================
name: Lint

on:
  push:
    branches:
      - master
  pull_request:
  schedule:
    - cron: '0 3 * * 1'

jobs:
  analyze:
    name: lint
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false

    permissions:
      # required for codeql analysis
      security-events: write

    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-go@v6
        with:
          go-version: 'stable'
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v9
        with:
          args: --timeout 120s --max-same-issues 50

      - name: Bearer
        uses: bearer/bearer-action@v2
        with:
          skip-path: 'docs/'

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v4
        with:
          languages: go
      - name: Autobuild
        uses: github/codeql-action/autobuild@v4
      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v4

      # - name: Install mdsf
      #   uses: hougesen/mdsf@main
      # - name: Run mdsf
      #   run: mdsf --debug --log-level warn docs/


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

on:
  workflow_dispatch:
    inputs:
      semver:
        type: string
        description: 'Semver (eg: v1.2.3)'
        required: true

jobs:
  release:
    if: github.triggering_actor == 'samber'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6

    - name: Set up Go
      uses: actions/setup-go@v6
      with:
        go-version-file: 'go.mod'

    - name: Test
      run: make test

    # remove tests to clean dependencies
    - name: Remove xxx_test.go files
      run: rm -rf $(find . -type f -name "*_test.go" ! -name "*_example_test.go") docs/ benchmark/

    # cleanup test dependencies
    - name: Cleanup dependencies
      run: go mod tidy

    - name: List files
      run: tree -Cfi
    - name: Write new go.mod into logs
      run: cat go.mod
    - name: Write new go.sum into logs
      run: cat go.sum

    - name: Create tag
      run: |
          git config --global user.name '${{ github.triggering_actor }}'
          git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com"

          git add .
          git commit --allow-empty -m 'bump ${{ inputs.semver }}'
          git tag ${{ inputs.semver }}
          git push origin ${{ inputs.semver }}

    - name: Release
      uses: softprops/action-gh-release@v2
      with:
        name: ${{ inputs.semver }}
        tag_name: ${{ inputs.semver }}


================================================
FILE: .github/workflows/test.simd.yml
================================================
name: Tests (SIMD)

on:
  push:
    branches:
      - master
    paths:
      - 'exp/simd/**'
  pull_request:
    paths:
      - 'exp/simd/**'

env:
  GOEXPERIMENT: simd

jobs:
  test-simd:
    # GitHub hosted runners run on several architectures.
    # Using Ubicloud ensures we run on AVX512.
    runs-on: ubicloud-standard-2
    strategy:
      fail-fast: false
      matrix:
        go:
          - "stable"

    steps:
      - uses: actions/checkout@v6

      - name: Set up Go
        uses: actions/setup-go@v6
        with:
          go-version: ${{ matrix.go }}

      - name: Test
        run: make test

      - name: Benchmark
        run: |
          cd exp/simd/
          GOEXPERIMENT=simd go test -run=^Benchmark -benchmem -bench ./...


================================================
FILE: .github/workflows/test.yml
================================================
name: Tests

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        go:
          - "1.18"
          - "1.19"
          - "1.20"
          - "1.21"
          - "1.22"
          - "1.23"
          - "1.24"
          - "1.25"
          - "1.26"
          - "stable"

    steps:
      - uses: actions/checkout@v6

      - name: Set up Go
        uses: actions/setup-go@v6
        with:
          go-version: ${{ matrix.go }}

      - name: Build
        run: make build

      - name: Test
        run: make test

      - name: Test coverage
        run: make coverage
        if: matrix.go == 'stable'

      - name: Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          flags: unittests
          verbose: true
        if: matrix.go == 'stable'


================================================
FILE: .gitignore
================================================

# Created by https://www.toptal.com/developers/gitignore/api/go
# Edit at https://www.toptal.com/developers/gitignore?templates=go

### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

### Go Patch ###
/vendor/
/Godeps/

# End of https://www.toptal.com/developers/gitignore/api/go

cover.out
cover.html
.vscode

.idea/


================================================
FILE: .golangci.yml
================================================
version: "2"
run:
  concurrency: 4
  # also lint _test.go files
  tests: true
  timeout: 5m
linters:
  enable:
    - govet
    - staticcheck
    - unused
    - errcheck
    - gocritic
    - gocyclo
    - revive
    - ineffassign
    - unconvert
    - goconst
    # - depguard
    - prealloc
    # - dupl
    - misspell
    - bodyclose
    - sqlclosecheck
    - nilerr
    - nestif
    - forcetypeassert
    - exhaustive
    - funlen
    # - wsl_v5
    - testifylint
    - whitespace
    - perfsprint
    - nolintlint
    - godot
    - thelper
    - tparallel
    - paralleltest
    - predeclared
    - modernize

  # disable noisy/controversial ones which you might enable later
  disable:
    - lll          # line length — handled by gofmt/gofumpt

  settings:
    dupl:
      threshold: 20  # lower => stricter (tokens)
    errcheck:
      check-type-assertions: true
    funlen:
      lines: 120
      statements: 80
    goconst:
      min-len: 2
      min-occurrences: 3
    gocyclo:
      min-complexity: 15 # strict; lower => stricter
    wsl_v5:
      allow-first-in-block: true
      allow-whole-block: false
      branch-max-lines: 2
    testifylint:
      disable:
        - require-error
        - float-compare

  exclusions:
    generated: lax
    paths:
      - examples$
    rules:
      - linters:
          - revive
        text: "^unused-parameter:"
      - linters:
          - revive
        text: "^package-comments:"
      - linters:
          - errcheck
        text: "Error return value of `.*\\.Body\\.Close` is not checked"
      # linters disabled in tests
      - linters:
          - dupl
          - goconst
          - funlen
        path: "_test\\.go$"

issues:
  max-issues-per-linter: 0  # 0 = unlimited (we want ALL issues)
  max-same-issues: 100

formatters:
  enable:
    - gofmt
    - gofumpt
  settings:
    gofumpt:
      extra-rules: true
  exclusions:
    generated: lax
    paths:
      - third_party$
      - builtin$
      - examples$


================================================
FILE: Dockerfile
================================================

FROM golang:1.23.1

WORKDIR /go/src/github.com/samber/lo

COPY Makefile go.* ./

RUN make tools


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2022-2025 Samuel Berthe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: Makefile
================================================
# Only build/test/lint exp/simd when Go version is >= 1.26 (requires goexperiment.simd)
GO_VERSION := $(shell go version 2>/dev/null | sed -n 's/.*go\([0-9]*\)\.\([0-9]*\).*/\1.\2/p')
GO_SIMD_SUPPORT := $(shell ver="$(GO_VERSION)"; [ -n "$$ver" ] && [ "$$(printf '%s\n1.26\n' "$$ver" | sort -V | tail -1)" = "$$ver" ] && echo yes)

build:
	go build -v ./...
	@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && GOEXPERIMENT=simd go build -v ./; fi

test:
	go test -race ./...
	@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && GOEXPERIMENT=simd go test -race ./; fi
watch-test:
	reflex -t 50ms -s -- sh -c 'gotest -race ./...'

bench:
	go test -v -run=^Benchmark -benchmem -count 3 -bench ./...
watch-bench:
	reflex -t 50ms -s -- sh -c 'go test -v -run=^Benchmark -benchmem -count 3 -bench ./...'

coverage:
	go test -v -coverprofile=cover.out -covermode=atomic ./...
	go tool cover -html=cover.out -o cover.html

tools:
	go install github.com/cespare/reflex@latest
	go install github.com/rakyll/gotest@latest
	go install github.com/psampaz/go-mod-outdated@latest
	go install github.com/jondot/goweight@latest
	go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
	go get -t -u golang.org/x/tools/cmd/cover
	go install github.com/sonatype-nexus-community/nancy@latest
	go install golang.org/x/perf/cmd/benchstat@latest
	go install github.com/cespare/prettybench@latest
	go mod tidy

	# brew install hougesen/tap/mdsf

lint:
	golangci-lint run --timeout 60s --max-same-issues 50 ./...
	@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && golangci-lint run --timeout 60s --max-same-issues 50 ./; fi
	# mdsf verify --debug --log-level warn docs/
lint-fix:
	golangci-lint run --timeout 60s --max-same-issues 50 --fix ./...
	@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && golangci-lint run --timeout 60s --max-same-issues 50 --fix ./; fi
	# mdsf format --debug --log-level warn docs/

audit:
	go list -json -m all | nancy sleuth

outdated:
	go list -u -m -json all | go-mod-outdated -update -direct

weight:
	goweight

doc:
	cd docs && npm install && npm start


================================================
FILE: README.md
================================================

# lo - Iterate over slices, maps, channels...

[![tag](https://img.shields.io/github/tag/samber/lo.svg)](https://github.com/samber/lo/releases)
![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.18-%23007d9c)
[![GoDoc](https://godoc.org/github.com/samber/lo?status.svg)](https://pkg.go.dev/github.com/samber/lo)
![Build Status](https://github.com/samber/lo/actions/workflows/test.yml/badge.svg)
[![Go report](https://goreportcard.com/badge/github.com/samber/lo)](https://goreportcard.com/report/github.com/samber/lo)
[![Coverage](https://img.shields.io/codecov/c/github/samber/lo)](https://codecov.io/gh/samber/lo)
[![Contributors](https://img.shields.io/github/contributors/samber/lo)](https://github.com/samber/lo/graphs/contributors)
[![License](https://img.shields.io/github/license/samber/lo)](./LICENSE)

✨ **`samber/lo` is a Lodash-style Go library based on Go 1.18+ Generics.**

A utility library based on Go 1.18+ generics that makes it easier to work with slices, maps, strings, channels, and functions. It provides dozens of handy methods to simplify common coding tasks and improve code readability. It may look like [Lodash](https://github.com/lodash/lodash) in some aspects.

5 to 10 helpers may overlap with those from the Go standard library, in packages `slices` and `maps`. I feel this library is legitimate and offers many more valuable abstractions.

**See also:**

- [samber/ro](https://github.com/samber/ro): Reactive Programming for Go: declarative and composable API for event-driven applications
- [samber/do](https://github.com/samber/do): A dependency injection toolkit based on Go 1.18+ Generics
- [samber/mo](https://github.com/samber/mo): Monads based on Go 1.18+ Generics (Option, Result, Either...)

What makes it different from **samber/ro**?
- lo: synchronous helpers across finite sequences (maps, slices...)
- ro: processing of infinite data streams for event-driven scenarios

----

<div align="center">
  <sup><b>💖 Sponsored by:</b></sup>
  <br>
  <a href="https://www.dbos.dev/?utm_campaign=gh-smbr">
    <div>
	  <img width="200" alt="dbos" src="https://github.com/user-attachments/assets/d583cb62-7735-4d3c-beb7-e6ef1a5faf49" />
    </div>
    <div>
      DBOS - Durable workflow orchestration library for Go
    </div>
  </a>
</div>

----

**Why this name?**

I wanted a **short name**, similar to "Lodash", and no Go package uses this name.

![lo](docs/static/img/logo-full.png)

## 🚀 Install

```sh
go get github.com/samber/lo@v1
```

This library is v1 and follows SemVer strictly.

No breaking changes will be made to exported APIs before v2.0.0, except for experimental packages under `exp/`.

This library has no dependencies outside the Go standard library.

## 💡 Usage

You can import `lo` using:

```go
import (
    "github.com/samber/lo"
    lop "github.com/samber/lo/parallel"
    lom "github.com/samber/lo/mutable"
    loi "github.com/samber/lo/it"
)
```

Then use one of the helpers below:

```go
names := lo.Uniq([]string{"Samuel", "John", "Samuel"})
// []string{"Samuel", "John"}
```

### Tips for lazy developers

I cannot recommend it, but in case you are too lazy for repeating `lo.` everywhere, you can import the entire library into the namespace.

```go
import (
    . "github.com/samber/lo"
)
```

I take no responsibility for this junk. 😁 💩

## 🤠 Spec

GoDoc: [godoc.org/github.com/samber/lo](https://godoc.org/github.com/samber/lo)

Documentation: [lo.samber.dev](https://lo.samber.dev/docs/about)

Supported helpers for slices:

- [Filter](#filter)
- [Map](#map)
- [UniqMap](#uniqmap)
- [FilterMap](#filtermap)
- [FlatMap](#flatmap)
- [Reduce](#reduce)
- [ReduceRight](#reduceright)
- [ForEach](#foreach)
- [ForEachWhile](#foreachwhile)
- [Times](#times)
- [Uniq](#uniq)
- [UniqBy](#uniqby)
- [GroupBy](#groupby)
- [GroupByMap](#groupbymap)
- [Chunk](#chunk)
- [Window](#window)
- [Sliding](#sliding)
- [PartitionBy](#partitionby)
- [Flatten](#flatten)
- [Concat](#concat)
- [Interleave](#interleave)
- [Shuffle](#shuffle)
- [Reverse](#reverse)
- [Fill](#fill)
- [Repeat](#repeat)
- [RepeatBy](#repeatby)
- [KeyBy](#keyby)
- [SliceToMap / Associate](#slicetomap-alias-associate)
- [FilterSliceToMap](#filterslicetomap)
- [Keyify](#keyify)
- [Take](#take)
- [TakeWhile](#takewhile)
- [TakeFilter](#takefilter)
- [Drop](#drop)
- [DropRight](#dropright)
- [DropWhile](#dropwhile)
- [DropRightWhile](#droprightwhile)
- [DropByIndex](#DropByIndex)
- [Reject](#reject)
- [RejectMap](#rejectmap)
- [FilterReject](#filterreject)
- [Count](#count)
- [CountBy](#countby)
- [CountValues](#countvalues)
- [CountValuesBy](#countvaluesby)
- [Subset](#subset)
- [Slice](#slice)
- [Replace](#replace)
- [ReplaceAll](#replaceall)
- [Clone](#clone)
- [Compact](#compact)
- [IsSorted](#issorted)
- [IsSortedBy](#issortedby)
- [Splice](#Splice)
- [Cut](#Cut)
- [CutPrefix](#CutPrefix)
- [CutSuffix](#CutSuffix)
- [Trim](#Trim)
- [TrimLeft](#TrimLeft)
- [TrimPrefix](#TrimPrefix)
- [TrimRight](#TrimRight)
- [TrimSuffix](#TrimSuffix)

Supported helpers for maps:

- [Keys](#keys)
- [UniqKeys](#uniqkeys)
- [HasKey](#haskey)
- [ValueOr](#valueor)
- [Values](#values)
- [UniqValues](#uniqvalues)
- [PickBy](#pickby)
- [PickByKeys](#pickbykeys)
- [PickByValues](#pickbyvalues)
- [OmitBy](#omitby)
- [OmitByKeys](#omitbykeys)
- [OmitByValues](#omitbyvalues)
- [Entries / ToPairs](#entries-alias-topairs)
- [FromEntries / FromPairs](#fromentries-alias-frompairs)
- [Invert](#invert)
- [Assign (merge of maps)](#assign)
- [ChunkEntries](#chunkentries)
- [MapKeys](#mapkeys)
- [MapValues](#mapvalues)
- [MapEntries](#mapentries)
- [MapToSlice](#maptoslice)
- [FilterMapToSlice](#FilterMapToSlice)
- [FilterKeys](#FilterKeys)
- [FilterValues](#FilterValues)

Supported math helpers:

- [Range / RangeFrom / RangeWithSteps](#range--rangefrom--rangewithsteps)
- [Clamp](#clamp)
- [Sum](#sum)
- [SumBy](#sumby)
- [Product](#product)
- [ProductBy](#productby)
- [Mean](#mean)
- [MeanBy](#meanby)
- [Mode](#mode)

Supported helpers for strings:

- [RandomString](#randomstring)
- [Substring](#substring)
- [ChunkString](#chunkstring)
- [RuneLength](#runelength)
- [PascalCase](#pascalcase)
- [CamelCase](#camelcase)
- [KebabCase](#kebabcase)
- [SnakeCase](#snakecase)
- [Words](#words)
- [Capitalize](#capitalize)
- [Ellipsis](#ellipsis)

Supported helpers for tuples:

- [T2 -> T9](#t2---t9)
- [Unpack2 -> Unpack9](#unpack2---unpack9)
- [Zip2 -> Zip9](#zip2---zip9)
- [ZipBy2 -> ZipBy9](#zipby2---zipby9)
- [Unzip2 -> Unzip9](#unzip2---unzip9)
- [UnzipBy2 -> UnzipBy9](#unzipby2---unzipby9)
- [CrossJoin2 -> CrossJoin2](#crossjoin2---crossjoin9)
- [CrossJoinBy2 -> CrossJoinBy2](#crossjoinby2---crossjoinby9)

Supported helpers for time and duration:

- [Duration](#duration)
- [Duration0 -> Duration10](#duration0---duration10)

Supported helpers for channels:

- [ChannelDispatcher](#channeldispatcher)
- [SliceToChannel](#slicetochannel)
- [ChannelToSlice](#channeltoslice)
- [Generator](#generator)
- [Buffer](#buffer)
- [BufferWithContext](#bufferwithcontext)
- [BufferWithTimeout](#bufferwithtimeout)
- [FanIn](#fanin)
- [FanOut](#fanout)

Supported intersection helpers:

- [Contains](#contains)
- [ContainsBy](#containsby)
- [Every](#every)
- [EveryBy](#everyby)
- [Some](#some)
- [SomeBy](#someby)
- [None](#none)
- [NoneBy](#noneby)
- [Intersect](#intersect)
- [IntersectBy](#intersectby)
- [Difference](#difference)
- [Union](#union)
- [Without](#without)
- [WithoutBy](#withoutby)
- [WithoutEmpty](#withoutempty)
- [WithoutNth](#withoutnth)
- [ElementsMatch](#ElementsMatch)
- [ElementsMatchBy](#ElementsMatchBy)

Supported search helpers:

- [IndexOf](#indexof)
- [LastIndexOf](#lastindexof)
- [HasPrefix](#hasprefix)
- [HasSuffix](#hassuffix)
- [Find](#find)
- [FindIndexOf](#findindexof)
- [FindLastIndexOf](#findlastindexof)
- [FindOrElse](#findorelse)
- [FindKey](#findkey)
- [FindKeyBy](#findkeyby)
- [FindUniques](#finduniques)
- [FindUniquesBy](#finduniquesby)
- [FindDuplicates](#findduplicates)
- [FindDuplicatesBy](#findduplicatesby)
- [Min](#min)
- [MinIndex](#minindex)
- [MinBy](#minby)
- [MinIndexBy](#minindexby)
- [Earliest](#earliest)
- [EarliestBy](#earliestby)
- [Max](#max)
- [MaxIndex](#maxindex)
- [MaxBy](#maxby)
- [MaxIndexBy](#maxindexby)
- [Latest](#latest)
- [LatestBy](#latestby)
- [First](#first)
- [FirstOrEmpty](#FirstOrEmpty)
- [FirstOr](#FirstOr)
- [Last](#last)
- [LastOrEmpty](#LastOrEmpty)
- [LastOr](#LastOr)
- [Nth](#nth)
- [NthOr](#nthor)
- [NthOrEmpty](#nthorempty)
- [Sample](#sample)
- [SampleBy](#sampleby)
- [Samples](#samples)
- [SamplesBy](#samplesby)

Conditional helpers:

- [Ternary](#ternary)
- [TernaryF](#ternaryf)
- [If / ElseIf / Else](#if--elseif--else)
- [Switch / Case / Default](#switch--case--default)

Type manipulation helpers:

- [IsNil](#isnil)
- [IsNotNil](#isnotnil)
- [ToPtr](#toptr)
- [Nil](#nil)
- [EmptyableToPtr](#emptyabletoptr)
- [FromPtr](#fromptr)
- [FromPtrOr](#fromptror)
- [ToSlicePtr](#tosliceptr)
- [FromSlicePtr](#fromsliceptr)
- [FromSlicePtrOr](#fromsliceptror)
- [ToAnySlice](#toanyslice)
- [FromAnySlice](#fromanyslice)
- [Empty](#empty)
- [IsEmpty](#isempty)
- [IsNotEmpty](#isnotempty)
- [Coalesce](#coalesce)
- [CoalesceOrEmpty](#coalesceorempty)
- [CoalesceSlice](#coalesceslice)
- [CoalesceSliceOrEmpty](#coalescesliceorempty)
- [CoalesceMap](#coalescemap)
- [CoalesceMapOrEmpty](#coalescemaporempty)

Function helpers:

- [Partial](#partial)
- [Partial2 -> Partial5](#partial2---partial5)

Concurrency helpers:

- [Attempt](#attempt)
- [AttemptWhile](#attemptwhile)
- [AttemptWithDelay](#attemptwithdelay)
- [AttemptWhileWithDelay](#attemptwhilewithdelay)
- [Debounce](#debounce)
- [DebounceBy](#debounceby)
- [Throttle](#throttle)
- [ThrottleWithCount](#throttle)
- [ThrottleBy](#throttle)
- [ThrottleByWithCount](#throttle)
- [Synchronize](#synchronize)
- [Async](#async)
- [Async{0->6}](#async0-6)
- [Transaction](#transaction)
- [WaitFor](#waitfor)
- [WaitForWithContext](#waitforwithcontext)

Error handling:

- [Validate](#validate)
- [Must](#must)
- [Try](#try)
- [Try1 -> Try6](#try0-6)
- [TryOr](#tryor)
- [TryOr1 -> TryOr6](#tryor0-6)
- [TryCatch](#trycatch)
- [TryWithErrorValue](#trywitherrorvalue)
- [TryCatchWithErrorValue](#trycatchwitherrorvalue)
- [ErrorsAs](#errorsas)
- [Assert](#assert)
- [Assertf](#assertf)

Constraints:

- Clonable

### Filter

Iterates over a collection and returns a slice of all the elements the predicate function returns `true` for.

```go
even := lo.Filter([]int{1, 2, 3, 4}, func(x int, index int) bool {
    return x%2 == 0
})
// []int{2, 4}
```

```go
// Use FilterErr when the predicate can return an error
even, err := lo.FilterErr([]int{1, 2, 3, 4}, func(x int, _ int) (bool, error) {
    if x == 3 {
        return false, fmt.Errorf("number 3 is not allowed")
    }
    return x%2 == 0, nil
})
// []int(nil), error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/Apjg3WeSi7K)]

Mutable: like `lo.Filter()`, but the slice is updated in place.

```go
import lom "github.com/samber/lo/mutable"

list := []int{1, 2, 3, 4}
newList := lom.Filter(list, func(x int) bool {
    return x%2 == 0
})

list
// []int{2, 4, 3, 4}

newList
// []int{2, 4}
```

### Map

Manipulates a slice of one type and transforms it into a slice of another type:

```go
import "github.com/samber/lo"

lo.Map([]int64{1, 2, 3, 4}, func(x int64, index int) string {
    return strconv.FormatInt(x, 10)
})
// []string{"1", "2", "3", "4"}
```

```go
// Use MapErr when the transform function can return an error
result, err := lo.MapErr([]int{1, 2, 3, 4}, func(x int, _ int) (string, error) {
    if x == 3 {
        return "", fmt.Errorf("number 3 is not allowed")
    }
    return strconv.Itoa(x), nil
})
// []string(nil), error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/OkPcYAhBo0D)]

Parallel processing: like `lo.Map()`, but the transform function is called in a goroutine. Results are returned in the same order.

```go
import lop "github.com/samber/lo/parallel"

lop.Map([]int64{1, 2, 3, 4}, func(x int64, _ int) string {
    return strconv.FormatInt(x, 10)
})
// []string{"1", "2", "3", "4"}
```

[[play](https://go.dev/play/p/sCJaB3quRMC)]

Mutable: like `lo.Map()`, but the slice is updated in place.

```go
import lom "github.com/samber/lo/mutable"

list := []int{1, 2, 3, 4}
lom.Map(list, func(x int) int {
    return x*2
})
// []int{2, 4, 6, 8}
```

[[play](https://go.dev/play/p/0jY3Z0B7O_5)]

### UniqMap

Manipulates a slice and transforms it to a slice of another type with unique values.

```go
type User struct {
    Name string
    Age  int
}
users := []User{{Name: "Alex", Age: 10}, {Name: "Alex", Age: 12}, {Name: "Bob", Age: 11}, {Name: "Alice", Age: 20}}

names := lo.UniqMap(users, func(u User, index int) string {
    return u.Name
})
// []string{"Alex", "Bob", "Alice"}
```

[[play](https://go.dev/play/p/fygzLBhvUdB)]

### FilterMap

Returns a slice obtained after both filtering and mapping using the given callback function.

The callback function should return two values: the result of the mapping operation and whether the result element should be included or not.

```go
matching := lo.FilterMap([]string{"cpu", "gpu", "mouse", "keyboard"}, func(x string, _ int) (string, bool) {
    if strings.HasSuffix(x, "pu") {
        return "xpu", true
    }
    return "", false
})
// []string{"xpu", "xpu"}
```

[[play](https://go.dev/play/p/-AuYXfy7opz)]

### FlatMap

Manipulates a slice and transforms and flattens it to a slice of another type. The transform function can either return a slice or a `nil`, and in the `nil` case no value is added to the final slice.

```go
lo.FlatMap([]int64{0, 1, 2}, func(x int64, _ int) []string {
    return []string{
        strconv.FormatInt(x, 10),
        strconv.FormatInt(x, 10),
    }
})
// []string{"0", "0", "1", "1", "2", "2"}
```

```go
// Use FlatMapErr when the transform function can return an error
result, err := lo.FlatMapErr([]int64{0, 1, 2, 3}, func(x int64, _ int) ([]string, error) {
    if x == 2 {
        return nil, fmt.Errorf("number 2 is not allowed")
    }
    return []string{strconv.FormatInt(x, 10), strconv.FormatInt(x, 10)}, nil
})
// []string(nil), error("number 2 is not allowed")
```

[[play](https://go.dev/play/p/YSoYmQTA8-U)]

### Reduce

Reduces a collection to a single value. The value is calculated by accumulating the result of running each element in the collection through an accumulator function. Each successive invocation is supplied with the return value returned by the previous call.

```go
sum := lo.Reduce([]int{1, 2, 3, 4}, func(agg int, item int, _ int) int {
    return agg + item
}, 0)
// 10
```

```go
// Use ReduceErr when the accumulator function can return an error
result, err := lo.ReduceErr([]int{1, 2, 3, 4}, func(agg int, item int, _ int) (int, error) {
    if item == 3 {
        return 0, fmt.Errorf("number 3 is not allowed")
    }
    return agg + item, nil
}, 0)
// 0, error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/R4UHXZNaaUG)]

### ReduceRight

Like `lo.Reduce` except that it iterates over elements of collection from right to left.

```go
result := lo.ReduceRight([][]int{{0, 1}, {2, 3}, {4, 5}}, func(agg []int, item []int, _ int) []int {
    return append(agg, item...)
}, []int{})
// []int{4, 5, 2, 3, 0, 1}
```

```go
// Use ReduceRightErr when the accumulator function can return an error
result, err := lo.ReduceRightErr([]int{1, 2, 3, 4}, func(agg int, item int, _ int) (int, error) {
    if item == 2 {
        return 0, fmt.Errorf("number 2 is not allowed")
    }
    return agg + item, nil
}, 0)
// 0, error("number 2 is not allowed")
```

[[play](https://go.dev/play/p/Fq3W70l7wXF)]

### ForEach

Iterates over elements of a collection and invokes the function over each element.

```go
import "github.com/samber/lo"

lo.ForEach([]string{"hello", "world"}, func(x string, _ int) {
    println(x)
})
// prints "hello\nworld\n"
```

[[play](https://go.dev/play/p/oofyiUPRf8t)]

Parallel processing: like `lo.ForEach()`, but the callback is called as a goroutine.

```go
import lop "github.com/samber/lo/parallel"

lop.ForEach([]string{"hello", "world"}, func(x string, _ int) {
    println(x)
})
// prints "hello\nworld\n" or "world\nhello\n"
```

### ForEachWhile

Iterates over collection elements and invokes iteratee for each element collection return value decide to continue or break, like do while().

```go
list := []int64{1, 2, -42, 4}

lo.ForEachWhile(list, func(x int64, _ int) bool {
	if x < 0 {
		return false
	}
	fmt.Println(x)
	return true
})
// 1
// 2
```

[[play](https://go.dev/play/p/QnLGt35tnow)]

### Times

Times invokes the iteratee n times, returning a slice of the results of each invocation. The iteratee is invoked with index as argument.

```go
import "github.com/samber/lo"

lo.Times(3, func(i int) string {
    return strconv.FormatInt(int64(i), 10)
})
// []string{"0", "1", "2"}
```

[[play](https://go.dev/play/p/vgQj3Glr6lT)]

Parallel processing: like `lo.Times()`, but callback is called in goroutine.

```go
import lop "github.com/samber/lo/parallel"

lop.Times(3, func(i int) string {
    return strconv.FormatInt(int64(i), 10)
})
// []string{"0", "1", "2"}
```

### Uniq

Returns a duplicate-free version of a slice, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the slice.

```go
uniqValues := lo.Uniq([]int{1, 2, 2, 1})
// []int{1, 2}
```

[[play](https://go.dev/play/p/DTzbeXZ6iEN)]

### UniqBy

Returns a duplicate-free version of a slice, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is invoked for each element in the slice to generate the criterion by which uniqueness is computed.

```go
uniqValues := lo.UniqBy([]int{0, 1, 2, 3, 4, 5}, func(i int) int {
    return i%3
})
// []int{0, 1, 2}
```

```go
// Use UniqByErr when the iteratee function can return an error
result, err := lo.UniqByErr([]int{0, 1, 2, 3, 4, 5}, func(i int) (int, error) {
    if i == 3 {
        return 0, fmt.Errorf("number 3 is not allowed")
    }
    return i % 3, nil
})
// []int(nil), error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/g42Z3QSb53u)]

### GroupBy

Returns an object composed of keys generated from the results of running each element of collection through iteratee.

```go
import lo "github.com/samber/lo"

groups := lo.GroupBy([]int{0, 1, 2, 3, 4, 5}, func(i int) int {
    return i%3
})
// map[int][]int{0: []int{0, 3}, 1: []int{1, 4}, 2: []int{2, 5}}
```

```go
// Use GroupByErr when the iteratee function can return an error
result, err := lo.GroupByErr([]int{0, 1, 2, 3, 4, 5}, func(i int) (int, error) {
    if i == 3 {
        return 0, fmt.Errorf("number 3 is not allowed")
    }
    return i % 3, nil
})
// map[int][]int(nil), error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/XnQBd_v6brd)]

Parallel processing: like `lo.GroupBy()`, but callback is called in goroutine.

```go
import lop "github.com/samber/lo/parallel"

lop.GroupBy([]int{0, 1, 2, 3, 4, 5}, func(i int) int {
    return i%3
})
// map[int][]int{0: []int{0, 3}, 1: []int{1, 4}, 2: []int{2, 5}}
```

### GroupByMap

Returns an object composed of keys generated from the results of running each element of collection through iteratee.

```go
import lo "github.com/samber/lo"

groups := lo.GroupByMap([]int{0, 1, 2, 3, 4, 5}, func(i int) (int, int) {
    return i%3, i*2
})
// map[int][]int{0: []int{0, 6}, 1: []int{2, 8}, 2: []int{4, 10}}
```

```go
// Use GroupByMapErr when the transform function can return an error
result, err := lo.GroupByMapErr([]int{0, 1, 2, 3, 4, 5}, func(i int) (int, int, error) {
    if i == 3 {
        return 0, 0, fmt.Errorf("number 3 is not allowed")
    }
    return i % 3, i * 2, nil
})
// map[int][]int(nil), error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/iMeruQ3_W80)]

### Chunk

Returns a slice of elements split into groups of length size. If the slice can't be split evenly, the final chunk will be the remaining elements.

```go
lo.Chunk([]int{0, 1, 2, 3, 4, 5}, 2)
// [][]int{{0, 1}, {2, 3}, {4, 5}}

lo.Chunk([]int{0, 1, 2, 3, 4, 5, 6}, 2)
// [][]int{{0, 1}, {2, 3}, {4, 5}, {6}}

lo.Chunk([]int{}, 2)
// [][]int{}

lo.Chunk([]int{0}, 2)
// [][]int{{0}}
```

[[play](https://go.dev/play/p/kEMkFbdu85g)]

### Window

Creates a slice of sliding windows of a given size. Each window shares size-1 elements with the previous one. This is equivalent to `Sliding(collection, size, 1)`.

```go
lo.Window([]int{1, 2, 3, 4, 5}, 3)
// [][]int{{1, 2, 3}, {2, 3, 4}, {3, 4, 5}}

lo.Window([]float64{20, 22, 21, 23, 24}, 3)
// [][]float64{{20, 22, 21}, {22, 21, 23}, {21, 23, 24}}
```

### Sliding

Creates a slice of sliding windows of a given size with a given step. If step is equal to size, windows have no common elements (similar to Chunk). If step is less than size, windows share common elements.

```go
// Windows with shared elements (step < size)
lo.Sliding([]int{1, 2, 3, 4, 5, 6}, 3, 1)
// [][]int{{1, 2, 3}, {2, 3, 4}, {3, 4, 5}, {4, 5, 6}}

// Windows with no shared elements (step == size, like Chunk)
lo.Sliding([]int{1, 2, 3, 4, 5, 6}, 3, 3)
// [][]int{{1, 2, 3}, {4, 5, 6}}

// Step > size (skipping elements)
lo.Sliding([]int{1, 2, 3, 4, 5, 6, 7, 8}, 2, 3)
// [][]int{{1, 2}, {4, 5}, {7, 8}}
```

### PartitionBy

Returns a slice of elements split into groups. The order of grouped values is determined by the order they occur in collection. The grouping is generated from the results of running each element of collection through iteratee.

```go
import lo "github.com/samber/lo"

partitions := lo.PartitionBy([]int{-2, -1, 0, 1, 2, 3, 4, 5}, func(x int) string {
    if x < 0 {
        return "negative"
    } else if x%2 == 0 {
        return "even"
    }
    return "odd"
})
// [][]int{{-2, -1}, {0, 2, 4}, {1, 3, 5}}
```

```go
// Use PartitionByErr when the iteratee function can return an error
result, err := lo.PartitionByErr([]int{-2, -1, 0, 1, 2}, func(x int) (string, error) {
    if x == 0 {
        return "", fmt.Errorf("zero is not allowed")
    }
    if x < 0 {
        return "negative", nil
    } else if x%2 == 0 {
        return "even", nil
    }
    return "odd", nil
})
// [][]int(nil), error("zero is not allowed")
```

[[play](https://go.dev/play/p/NfQ_nGjkgXW)]

Parallel processing: like `lo.PartitionBy()`, but callback is called in goroutine. Results are returned in the same order.

```go
import lop "github.com/samber/lo/parallel"

partitions := lop.PartitionBy([]int{-2, -1, 0, 1, 2, 3, 4, 5}, func(x int) string {
    if x < 0 {
        return "negative"
    } else if x%2 == 0 {
        return "even"
    }
    return "odd"
})
// [][]int{{-2, -1}, {0, 2, 4}, {1, 3, 5}}
```

### Flatten

Returns a slice a single level deep.

```go
flat := lo.Flatten([][]int{{0, 1}, {2, 3, 4, 5}})
// []int{0, 1, 2, 3, 4, 5}
```

[[play](https://go.dev/play/p/rbp9ORaMpjw)]

### Concat

Returns a new slice containing all the elements in collections. Concat conserves the order of the elements.

```go
slice := lo.Concat([]int{1, 2}, []int{3, 4})
// []int{1, 2, 3, 4}

slice := lo.Concat(nil, []int{1, 2}, nil, []int{3, 4}, nil)
// []int{1, 2, 3, 4}

slice := lo.Concat[int]()
// []int{}
```
### Interleave

Round-robin alternating input slices and sequentially appending value at index into result.

```go
interleaved := lo.Interleave([]int{1, 4, 7}, []int{2, 5, 8}, []int{3, 6, 9})
// []int{1, 2, 3, 4, 5, 6, 7, 8, 9}

interleaved := lo.Interleave([]int{1}, []int{2, 5, 8}, []int{3, 6}, []int{4, 7, 9, 10})
// []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
```

[[play](https://go.dev/play/p/-RJkTLQEDVt)]

### Shuffle

Returns a slice of shuffled values. Uses the Fisher-Yates shuffle algorithm.

⚠️ This helper is **mutable**.

```go
import lom "github.com/samber/lo/mutable"

list := []int{0, 1, 2, 3, 4, 5}
lom.Shuffle(list)

list
// []int{1, 4, 0, 3, 5, 2}
```

[[play](https://go.dev/play/p/2xb3WdLjeSJ)]

### Reverse

Reverses a slice so that the first element becomes the last, the second element becomes the second to last, and so on.

⚠️ This helper is **mutable**.

```go
import lom "github.com/samber/lo/mutable"

list := []int{0, 1, 2, 3, 4, 5}
lom.Reverse(list)

list
// []int{5, 4, 3, 2, 1, 0}
```

[[play](https://go.dev/play/p/O-M5pmCRgzV)]

### Fill

Fills elements of a slice with `initial` value.

```go
type foo struct {
  bar string
}

func (f foo) Clone() foo {
  return foo{f.bar}
}

initializedSlice := lo.Fill([]foo{foo{"a"}, foo{"a"}}, foo{"b"})
// []foo{foo{"b"}, foo{"b"}}
```

[[play](https://go.dev/play/p/VwR34GzqEub)]

### Repeat

Builds a slice with N copies of initial value.

```go
type foo struct {
  bar string
}

func (f foo) Clone() foo {
  return foo{f.bar}
}

slice := lo.Repeat(2, foo{"a"})
// []foo{foo{"a"}, foo{"a"}}
```

[[play](https://go.dev/play/p/g3uHXbmc3b6)]

### RepeatBy

Builds a slice with values returned by N calls of callback.

```go
slice := lo.RepeatBy(0, func (i int) string {
    return strconv.FormatInt(int64(math.Pow(float64(i), 2)), 10)
})
// []string{}

slice := lo.RepeatBy(5, func(i int) string {
    return strconv.FormatInt(int64(math.Pow(float64(i), 2)), 10)
})
// []string{"0", "1", "4", "9", "16"}
```

[[play](https://go.dev/play/p/ozZLCtX_hNU)]

With error handling:

```go
slice, err := lo.RepeatByErr(5, func(i int) (string, error) {
    if i == 3 {
        return "", fmt.Errorf("index 3 is not allowed")
    }
    return fmt.Sprintf("item-%d", i), nil
})
// []string(nil), error("index 3 is not allowed")
```

### KeyBy

Transforms a slice or a slice of structs to a map based on a pivot callback.

```go
m := lo.KeyBy([]string{"a", "aa", "aaa"}, func(str string) int {
    return len(str)
})
// map[int]string{1: "a", 2: "aa", 3: "aaa"}

type Character struct {
  dir  string
  code int
}
characters := []Character{
    {dir: "left", code: 97},
    {dir: "right", code: 100},
}
result := lo.KeyBy(characters, func(char Character) string {
    return string(rune(char.code))
})
//map[a:{dir:left code:97} d:{dir:right code:100}]
```

```go
result, err := lo.KeyByErr([]string{"a", "aa", "aaa", ""}, func(str string) (int, error) {
    if str == "" {
        return 0, fmt.Errorf("empty string not allowed")
    }
    return len(str), nil
})
// map[int]string(nil), error("empty string not allowed")
```

[[play](https://go.dev/play/p/mdaClUAT-zZ)]

### SliceToMap (alias: Associate)

Returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
If any of two pairs have the same key the last one gets added to the map.

The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.

```go
in := []*foo{{baz: "apple", bar: 1}, {baz: "banana", bar: 2}}

aMap := lo.SliceToMap(in, func (f *foo) (string, int) {
    return f.baz, f.bar
})
// map[string][int]{ "apple":1, "banana":2 }
```

[[play](https://go.dev/play/p/WHa2CfMO3Lr)]

### FilterSliceToMap

Returns a map containing key-value pairs provided by transform function applied to elements of the given slice.

If any of two pairs have the same key the last one gets added to the map.

The order of keys in returned map is not specified and is not guaranteed to be the same from the original slice.

The third return value of the transform function is a boolean that indicates whether the key-value pair should be included in the map.

```go
list := []string{"a", "aa", "aaa"}

result := lo.FilterSliceToMap(list, func(str string) (string, int, bool) {
    return str, len(str), len(str) > 1
})
// map[string][int]{"aa":2 "aaa":3}
```

[[play](https://go.dev/play/p/2z0rDz2ZSGU)]

### Keyify

Returns a map with each unique element of the slice as a key.

```go
set := lo.Keyify([]int{1, 1, 2, 3, 4})
// map[int]struct{}{1:{}, 2:{}, 3:{}, 4:{}}
```

[[play](https://go.dev/play/p/RYhhM_csqIG)]

### Take

Takes the first n elements from a slice.

```go
l := lo.Take([]int{0, 1, 2, 3, 4, 5}, 3)
// []int{0, 1, 2}

l := lo.Take([]int{0, 1, 2}, 5)
// []int{0, 1, 2}
```

### TakeWhile

Takes elements from the beginning while the predicate returns true.

```go
l := lo.TakeWhile([]int{0, 1, 2, 3, 4, 5}, func(val int) bool {
    return val < 3
})
// []int{0, 1, 2}

l := lo.TakeWhile([]string{"a", "aa", "aaa", "aa"}, func(val string) bool {
    return len(val) <= 2
})
// []string{"a", "aa"}
```

### TakeFilter

Filters elements and takes the first n elements that match the predicate. Equivalent to calling Take(Filter(...)), but more efficient as it stops after finding n matches.

```go
l := lo.TakeFilter([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 3, func(val int, index int) bool {
    return val%2 == 0
})
// []int{2, 4, 6}

l := lo.TakeFilter([]string{"a", "aa", "aaa", "aaaa"}, 2, func(val string, index int) bool {
    return len(val) > 1
})
// []string{"aa", "aaa"}
```

### Drop

Drops n elements from the beginning of a slice.

```go
l := lo.Drop([]int{0, 1, 2, 3, 4, 5}, 2)
// []int{2, 3, 4, 5}
```

[[play](https://go.dev/play/p/JswS7vXRJP2)]

### DropRight

Drops n elements from the end of a slice.

```go
l := lo.DropRight([]int{0, 1, 2, 3, 4, 5}, 2)
// []int{0, 1, 2, 3}
```

[[play](https://go.dev/play/p/GG0nXkSJJa3)]

### DropWhile

Drop elements from the beginning of a slice while the predicate returns true.

```go
l := lo.DropWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string) bool {
    return len(val) <= 2
})
// []string{"aaa", "aa", "aa"}
```

[[play](https://go.dev/play/p/7gBPYw2IK16)]

### DropRightWhile

Drop elements from the end of a slice while the predicate returns true.

```go
l := lo.DropRightWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string) bool {
    return len(val) <= 2
})
// []string{"a", "aa", "aaa"}
```

[[play](https://go.dev/play/p/3-n71oEC0Hz)]

### DropByIndex

Drops elements from a slice by the index. A negative index will drop elements from the end of the slice.

```go
l := lo.DropByIndex([]int{0, 1, 2, 3, 4, 5}, 2, 4, -1)
// []int{0, 1, 3}
```

[[play](https://go.dev/play/p/JswS7vXRJP2)]

### Reject

The opposite of Filter, this method returns the elements of collection that predicate does not return true for.

```go
odd := lo.Reject([]int{1, 2, 3, 4}, func(x int, _ int) bool {
    return x%2 == 0
})
// []int{1, 3}
```

```go
// Use RejectErr when the predicate can return an error
odd, err := lo.RejectErr([]int{1, 2, 3, 4}, func(x int, _ int) (bool, error) {
    if x == 3 {
        return false, fmt.Errorf("number 3 is not allowed")
    }
    return x%2 == 0, nil
})
// []int(nil), error("number 3 is not allowed")
```

[[play](https://go.dev/play/p/YkLMODy1WEL)]

### RejectMap

The opposite of FilterMap, this method returns a slice obtained after both filtering and mapping using the given callback function.

The callback function should return two values:

- the result of the mapping operation and
- whether the result element should be included or not.

```go
items := lo.RejectMap([]int{1, 2, 3, 4}, func(x int, _ int) (int, bool) {
    return x*10, x%2 == 0
})
// []int{10, 30}
```

### FilterReject

Mixes Filter and Reject, this method returns two slices, one for the elements of collection that predicate returns true for and one for the elements that predicate does not return true for.

```go
kept, rejected := lo.FilterReject([]int{1, 2, 3, 4}, func(x int, _ int) bool {
    return x%2 == 0
})
// []int{2, 4}
// []int{1, 3}
```

### Count

Counts the number of elements in the collection that equal value.

```go
count := lo.Count([]int{1, 5, 1}, 1)
// 2
```

[[play](https://go.dev/play/p/Y3FlK54yveC)]

### CountBy

Counts the number of elements in the collection for which predicate is true.

```go
count := lo.CountBy([]int{1, 5, 1}, func(i int) bool {
    return i < 4
})
// 2
```

```go
// Use CountByErr when the predicate can return an error
count, err := lo.CountByErr([]int{1, 5, 1}, func(i int) (bool, error) {
    if i == 5 {
        return false, fmt.Errorf("5 not allowed")
    }
    return i < 4, nil
})
// 0, error("5 not allowed")
```

[[play](https://go.dev/play/p/ByQbNYQQi4X)]

### CountValues

Counts the number of each element in the collection.

```go
lo.CountValues([]int{})
// map[int]int{}

lo.CountValues([]int{1, 2})
// map[int]int{1: 1, 2: 1}

lo.CountValues([]int{1, 2, 2})
// map[int]int{1: 1, 2: 2}

lo.CountValues([]string{"foo", "bar", ""})
// map[string]int{"": 1, "foo": 1, "bar": 1}

lo.CountValues([]string{"foo", "bar", "bar"})
// map[string]int{"foo": 1, "bar": 2}
```

[[play](https://go.dev/play/p/-p-PyLT4dfy)]

### CountValuesBy

Counts the number of each element in the collection. It is equivalent to chaining lo.Map and lo.CountValues.

```go
isEven := func(v int) bool {
    return v%2==0
}

lo.CountValuesBy([]int{}, isEven)
// map[bool]int{}

lo.CountValuesBy([]int{1, 2}, isEven)
// map[bool]int{false: 1, true: 1}

lo.CountValuesBy([]int{1, 2, 2}, isEven)
// map[bool]int{false: 1, true: 2}

length := func(v string) int {
    return len(v)
}

lo.CountValuesBy([]string{"foo", "bar", ""}, length)
// map[int]int{0: 1, 3: 2}

lo.CountValuesBy([]string{"foo", "bar", "bar"}, length)
// map[int]int{3: 3}
```

[[play](https://go.dev/play/p/2U0dG1SnOmS)]

### Subset

Returns a copy of a slice from `offset` up to `length` elements. Like `slice[start:start+length]`, but does not panic on overflow.

```go
in := []int{0, 1, 2, 3, 4}

sub := lo.Subset(in, 2, 3)
// []int{2, 3, 4}

sub := lo.Subset(in, -4, 3)
// []int{1, 2, 3}

sub := lo.Subset(in, -2, math.MaxUint)
// []int{3, 4}
```

[[play](https://go.dev/play/p/tOQu1GhFcog)]

### Slice

Returns a copy of a slice from `start` up to, but not including `end`. Like `slice[start:end]`, but does not panic on overflow.

```go
in := []int{0, 1, 2, 3, 4}

slice := lo.Slice(in, 0, 5)
// []int{0, 1, 2, 3, 4}

slice := lo.Slice(in, 2, 3)
// []int{2}

slice := lo.Slice(in, 2, 6)
// []int{2, 3, 4}

slice := lo.Slice(in, 4, 3)
// []int{}
```

[[play](https://go.dev/play/p/8XWYhfMMA1h)]

### Replace

Returns a copy of the slice with the first n non-overlapping instances of old replaced by new.

```go
in := []int{0, 1, 0, 1, 2, 3, 0}

slice := lo.Replace(in, 0, 42, 1)
// []int{42, 1, 0, 1, 2, 3, 0}

slice := lo.Replace(in, -1, 42, 1)
// []int{0, 1, 0, 1, 2, 3, 0}

slice := lo.Replace(in, 0, 42, 2)
// []int{42, 1, 42, 1, 2, 3, 0}

slice := lo.Replace(in, 0, 42, -1)
// []int{42, 1, 42, 1, 2, 3, 42}
```

[[play](https://go.dev/play/p/XfPzmf9gql6)]

### ReplaceAll

Returns a copy of the slice with all non-overlapping instances of old replaced by new.

```go
in := []int{0, 1, 0, 1, 2, 3, 0}

slice := lo.ReplaceAll(in, 0, 42)
// []int{42, 1, 42, 1, 2, 3, 42}

slice := lo.ReplaceAll(in, -1, 42)
// []int{0, 1, 0, 1, 2, 3, 0}
```

[[play](https://go.dev/play/p/a9xZFUHfYcV)]

### Clone

Returns a shallow copy of the collection.

```go
in := []int{1, 2, 3, 4, 5}
cloned := lo.Clone(in)
// Verify it's a different slice by checking that modifying one doesn't affect the other
in[0] = 99
// cloned is []int{1, 2, 3, 4, 5}
```

[[play](https://go.dev/play/p/hgHmoOIxmuH)]

### Compact

Returns a slice of all non-zero elements.

```go
in := []string{"", "foo", "", "bar", ""}

slice := lo.Compact(in)
// []string{"foo", "bar"}
```

[[play](https://go.dev/play/p/tXiy-iK6PAc)]

### IsSorted

Checks if a slice is sorted.

```go
slice := lo.IsSorted([]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
// true
```

[[play](https://go.dev/play/p/mc3qR-t4mcx)]

### IsSortedBy

Checks if a slice is sorted by iteratee.

```go
slice := lo.IsSortedBy([]string{"a", "bb", "ccc"}, func(s string) int {
    return len(s)
})
// true
```

[[play](https://go.dev/play/p/wiG6XyBBu49)]

### Splice

Splice inserts multiple elements at index i. A negative index counts back from the end of the slice. The helper is protected against overflow errors.

```go
result := lo.Splice([]string{"a", "b"}, 1, "1", "2")
// []string{"a", "1", "2", "b"}

// negative
result = lo.Splice([]string{"a", "b"}, -1, "1", "2")
// []string{"a", "1", "2", "b"}

// overflow
result = lo.Splice([]string{"a", "b"}, 42, "1", "2")
// []string{"a", "b", "1", "2"}
```

[[play](https://go.dev/play/p/G5_GhkeSUBA)]

### Cut

Slices collection around the first instance of separator, returning the part of collection before and after separator. The found result reports whether separator appears in collection. If separator does not appear in s, cut returns collection, empty slice of []T, false.

```go
actualLeft, actualRight, result = lo.Cut([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"b", "c", "d"})
// actualLeft: []string{"a"}
// actualRight: []string{"e", "f", "g"}
// result: true

result = lo.Cut([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"z"})
// actualLeft: []string{"a", "b", "c", "d", "e", "f", "g"}
// actualRight: []string{}
// result: false

result = lo.Cut([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"a", "b"})
// actualLeft: []string{}
// actualRight: []string{"c", "d", "e", "f", "g"}
// result: true
```

[[play](https://go.dev/play/p/GiL3qhpIP3f)]

### CutPrefix

Returns collection without the provided leading prefix []T and reports whether it found the prefix. If s doesn't start with prefix, CutPrefix returns collection, false. If prefix is the empty []T, CutPrefix returns collection, true.

```go
actualRight, result = lo.CutPrefix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"a", "b", "c"})
// actualRight: []string{"d", "e", "f", "g"}
// result: true

result = lo.CutPrefix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"b"})
// actualRight: []string{"a", "b", "c", "d", "e", "f", "g"}
// result: false

result = lo.CutPrefix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{})
// actualRight: []string{"a", "b", "c", "d", "e", "f", "g"}
// result: true
```

[[play](https://go.dev/play/p/7Plak4a1ICl)]

### CutSuffix

Returns collection without the provided ending suffix []T and reports whether it found the suffix. If it doesn't end with suffix, CutSuffix returns collection, false. If suffix is the empty []T, CutSuffix returns collection, true.

```go
actualLeft, result = lo.CutSuffix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"f", "g"})
// actualLeft: []string{"a", "b", "c", "d", "e"}
// result: true

actualLeft, result = lo.CutSuffix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{"b"})
// actualLeft: []string{"a", "b", "c", "d", "e", "f", "g"}
// result: false

actualLeft, result = lo.CutSuffix([]string{"a", "b", "c", "d", "e", "f", "g"}, []string{})
// actualLeft: []string{"a", "b", "c", "d", "e", "f", "g"}
// result: true
```

[[play](https://go.dev/play/p/7FKfBFvPTaT)]

### Trim

Removes all the leading and trailing cutset from the collection.

```go
result := lo.Trim([]int{0, 1, 2, 0, 3, 0}, []int{1, 0})
// []int{2, 0, 3}

result := lo.Trim([]string{"hello", "world", " "}, []string{" ", ""})
// []string{"hello", "world"}
```

[[play](https://go.dev/play/p/1an9mxLdRG5)]

### TrimLeft

Removes all the leading cutset from the collection.

```go
result := lo.TrimLeft([]int{0, 1, 2, 0, 3, 0}, []int{1, 0})
// []int{2, 0, 3, 0}

result := lo.TrimLeft([]string{"hello", "world", " "}, []string{" ", ""})
// []string{"hello", "world", " "}
```

[[play](https://go.dev/play/p/74aqfAYLmyi)]

### TrimPrefix

Removes all the leading prefix from the collection.

```go
result := lo.TrimPrefix([]int{1, 2, 1, 2, 3, 1, 2, 4}, []int{1, 2})
// []int{3, 1, 2, 4}

result := lo.TrimPrefix([]string{"hello", "world", "hello", "test"}, []string{"hello"})
// []string{"world", "hello", "test"}
```

[[play](https://go.dev/play/p/SHO6X-YegPg)]

### TrimRight

Removes all the trailing cutset from the collection.

```go
result := lo.TrimRight([]int{0, 1, 2, 0, 3, 0}, []int{0, 3})
// []int{0, 1, 2}

result := lo.TrimRight([]string{"hello", "world", "  "}, []string{" ", ""})
// []string{"hello", "world", ""}
```

[[play](https://go.dev/play/p/MRpAfR6sf0g)]

### TrimSuffix

Removes all the trailing suffix from the collection.

```go
result := lo.TrimSuffix([]int{1, 2, 3, 1, 2, 4, 2, 4, 2, 4}, []int{2, 4})
// []int{1, 2, 3, 1}

result := lo.TrimSuffix([]string{"hello", "world", "hello", "test"}, []string{"test"})
// []string{"hello", "world", "hello"}
```

[[play](https://go.dev/play/p/IjEUrV0iofq)]

### Keys

Creates a slice of the map keys.

Use the UniqKeys variant to deduplicate common keys.

```go
keys := lo.Keys(map[string]int{"foo": 1, "bar": 2})
// []string{"foo", "bar"}

keys := lo.Keys(map[string]int{"foo": 1, "bar": 2}, map[string]int{"baz": 3})
// []string{"foo", "bar", "baz"}

keys := lo.Keys(map[string]int{"foo": 1, "bar": 2}, map[string]int{"bar": 3})
// []string{"foo", "bar", "bar"}
```

[[play](https://go.dev/play/p/Uu11fHASqrU)]

### UniqKeys

Creates a slice of unique map keys.

```go
keys := lo.UniqKeys(map[string]int{"foo": 1, "bar": 2}, map[string]int{"baz": 3})
// []string{"foo", "bar", "baz"}

keys := lo.UniqKeys(map[string]int{"foo": 1, "bar": 2}, map[string]int{"bar": 3})
// []string{"foo", "bar"}
```

[[play](https://go.dev/play/p/TPKAb6ILdHk)]

### HasKey

Returns whether the given key exists.

```go
exists := lo.HasKey(map[string]int{"foo": 1, "bar": 2}, "foo")
// true

exists := lo.HasKey(map[string]int{"foo": 1, "bar": 2}, "baz")
// false
```

[[play](https://go.dev/play/p/aVwubIvECqS)]

### Values

Creates a slice of the map values.

Use the UniqValues variant to deduplicate common values.

```go
values := lo.Values(map[string]int{"foo": 1, "bar": 2})
// []int{1, 2}

values := lo.Values(map[string]int{"foo": 1, "bar": 2}, map[string]int{"baz": 3})
// []int{1, 2, 3}

values := lo.Values(map[string]int{"foo": 1, "bar": 2}, map[string]int{"bar": 2})
// []int{1, 2, 2}
```

[[play](https://go.dev/play/p/nnRTQkzQfF6)]

### UniqValues

Creates a slice of unique map values.

```go
values := lo.UniqValues(map[string]int{"foo": 1, "bar": 2})
// []int{1, 2}

values := lo.UniqValues(map[string]int{"foo": 1, "bar": 2}, map[string]int{"baz": 3})
// []int{1, 2, 3}

values := lo.UniqValues(map[string]int{"foo": 1, "bar": 2}, map[string]int{"bar": 2})
// []int{1, 2}
```

[[play](https://go.dev/play/p/nf6bXMh7rM3)]

### ValueOr

Returns the value of the given key or the fallback value if the key is not present.

```go
value := lo.ValueOr(map[string]int{"foo": 1, "bar": 2}, "foo", 42)
// 1

value := lo.ValueOr(map[string]int{"foo": 1, "bar": 2}, "baz", 42)
// 42
```

[[play](https://go.dev/play/p/bAq9mHErB4V)]

### PickBy

Returns same map type filtered by given predicate.

```go
m := lo.PickBy(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(key string, value int) bool {
    return value%2 == 1
})
// map[string]int{"foo": 1, "baz": 3}
```

```go
// Use PickByErr when the predicate can return an error
m, err := lo.PickByErr(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(key string, value int) (bool, error) {
    if key == "bar" {
        return false, fmt.Errorf("bar not allowed")
    }
    return value%2 == 1, nil
})
// map[string]int(nil), error("bar not allowed")
```

[[play](https://go.dev/play/p/kdg8GR_QMmf)]

### PickByKeys

Returns same map type filtered by given keys.

```go
m := lo.PickByKeys(map[string]int{"foo": 1, "bar": 2, "baz": 3}, []string{"foo", "baz"})
// map[string]int{"foo": 1, "baz": 3}
```

[[play](https://go.dev/play/p/R1imbuci9qU)]

### PickByValues

Returns same map type filtered by given values.

```go
m := lo.PickByValues(map[string]int{"foo": 1, "bar": 2, "baz": 3}, []int{1, 3})
// map[string]int{"foo": 1, "baz": 3}
```

[[play](https://go.dev/play/p/1zdzSvbfsJc)]

### OmitBy

Returns same map type filtered by given predicate.

```go
m := lo.OmitBy(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(key string, value int) bool {
    return value%2 == 1
})
// map[string]int{"bar": 2}
```

```go
// Use OmitByErr when the predicate can return an error
m, err := lo.OmitByErr(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(key string, value int) (bool, error) {
    if key == "bar" {
        return false, fmt.Errorf("bar not allowed")
    }
    return value%2 == 1, nil
})
// map[string]int(nil), error("bar not allowed")
```

[[play](https://go.dev/play/p/EtBsR43bdsd)]

### OmitByKeys

Returns same map type filtered by given keys.

```go
m := lo.OmitByKeys(map[string]int{"foo": 1, "bar": 2, "baz": 3}, []string{"foo", "baz"})
// map[string]int{"bar": 2}
```

[[play](https://go.dev/play/p/t1QjCrs-ysk)]

### OmitByValues

Returns same map type filtered by given values.

```go
m := lo.OmitByValues(map[string]int{"foo": 1, "bar": 2, "baz": 3}, []int{1, 3})
// map[string]int{"bar": 2}
```

[[play](https://go.dev/play/p/9UYZi-hrs8j)]

### Entries (alias: ToPairs)

Transforms a map into a slice of key/value pairs.

```go
entries := lo.Entries(map[string]int{"foo": 1, "bar": 2})
// []lo.Entry[string, int]{
//     {
//         Key: "foo",
//         Value: 1,
//     },
//     {
//         Key: "bar",
//         Value: 2,
//     },
// }
```

[[play](https://go.dev/play/p/_t4Xe34-Nl5)]

### FromEntries (alias: FromPairs)

Transforms a slice of key/value pairs into a map.

```go
m := lo.FromEntries([]lo.Entry[string, int]{
    {
        Key: "foo",
        Value: 1,
    },
    {
        Key: "bar",
        Value: 2,
    },
})
// map[string]int{"foo": 1, "bar": 2}
```

[[play](https://go.dev/play/p/oIr5KHFGCEN)]

### Invert

Creates a map composed of the inverted keys and values. If map contains duplicate values, subsequent values overwrite property assignments of previous values.

```go
m1 := lo.Invert(map[string]int{"a": 1, "b": 2})
// map[int]string{1: "a", 2: "b"}

m2 := lo.Invert(map[string]int{"a": 1, "b": 2, "c": 1})
// map[int]string{1: "c", 2: "b"}
```

[[play](https://go.dev/play/p/rFQ4rak6iA1)]

### Assign

Merges multiple maps from left to right.

```go
mergedMaps := lo.Assign(
    map[string]int{"a": 1, "b": 2},
    map[string]int{"b": 3, "c": 4},
)
// map[string]int{"a": 1, "b": 3, "c": 4}
```

[[play](https://go.dev/play/p/VhwfJOyxf5o)]

### ChunkEntries

Splits a map into a slice of elements in groups of length equal to its size. If the map cannot be split evenly, the final chunk will contain the remaining elements.

```go
maps := lo.ChunkEntries(
    map[string]int{
        "a": 1,
        "b": 2,
        "c": 3,
        "d": 4,
        "e": 5,
    },
    3,
)
// []map[string]int{
//    {"a": 1, "b": 2, "c": 3},
//    {"d": 4, "e": 5},
// }
```
[[play](https://go.dev/play/p/X_YQL6mmoD-)]

### MapKeys

Manipulates map keys and transforms it to a map of another type.

```go
m2 := lo.MapKeys(map[int]int{1: 1, 2: 2, 3: 3, 4: 4}, func(_ int, v int) string {
    return strconv.FormatInt(int64(v), 10)
})
// map[string]int{"1": 1, "2": 2, "3": 3, "4": 4}
```

```go
// Use MapKeysErr when the iteratee can return an error
m2, err := lo.MapKeysErr(map[int]int{1: 1, 2: 2, 3: 3}, func(_ int, v int) (string, error) {
    if v == 2 {
        return "", fmt.Errorf("even number not allowed")
    }
    return strconv.FormatInt(int64(v), 10), nil
})
// map[string]int(nil), error("even number not allowed")
```

[[play](https://go.dev/play/p/9_4WPIqOetJ)]

### MapValues

Manipulates map values and transforms it to a map of another type.

```go
m1 := map[int]int64{1: 1, 2: 2, 3: 3}

m2 := lo.MapValues(m1, func(x int64, _ int) string {
    return strconv.FormatInt(x, 10)
})
// map[int]string{1: "1", 2: "2", 3: "3"}
```

```go
// Use MapValuesErr when the iteratee can return an error
m1 := map[int]int64{1: 1, 2: 2, 3: 3}
m2, err := lo.MapValuesErr(m1, func(x int64, _ int) (string, error) {
    if x == 2 {
        return "", fmt.Errorf("even number not allowed")
    }
    return strconv.FormatInt(x, 10), nil
})
// map[int]string(nil), error("even number not allowed")
```

[[play](https://go.dev/play/p/T_8xAfvcf0W)]

### MapEntries

Manipulates map entries and transforms it to a map of another type.

```go
in := map[string]int{"foo": 1, "bar": 2}

out := lo.MapEntries(in, func(k string, v int) (int, string) {
    return v,k
})
// map[int]string{1: "foo", 2: "bar"}
```

```go
// Use MapEntriesErr when the iteratee can return an error
in := map[string]int{"foo": 1, "bar": 2, "baz": 3}
out, err := lo.MapEntriesErr(in, func(k string, v int) (int, string, error) {
    if k == "bar" {
        return 0, "", fmt.Errorf("bar not allowed")
    }
    return v, k, nil
})
// map[int]string(nil), error("bar not allowed")
```

[[play](https://go.dev/play/p/VuvNQzxKimT)]

### MapToSlice

Transforms a map into a slice based on specified iteratee.

```go
m := map[int]int64{1: 4, 2: 5, 3: 6}

s := lo.MapToSlice(m, func(k int, v int64) string {
    return fmt.Sprintf("%d_%d", k, v)
})
// []string{"1_4", "2_5", "3_6"}
```

```go
// Use MapToSliceErr when the iteratee can return an error
m := map[int]int64{1: 4, 2: 5, 3: 6}
s, err := lo.MapToSliceErr(m, func(k int, v int64) (string, error) {
    if k == 2 {
        return "", fmt.Errorf("key 2 not allowed")
    }
    return fmt.Sprintf("%d_%d", k, v), nil
})
// []string(nil), error("key 2 not allowed")
```

[[play](https://go.dev/play/p/ZuiCZpDt6LD)]

### FilterMapToSlice

Transforms a map into a slice based on specified iteratee. The iteratee returns a value and a boolean. If the boolean is true, the value is added to the result slice.

If the boolean is false, the value is not added to the result slice. The order of the keys in the input map is not specified and the order of the keys in the output slice is not guaranteed.

```go
kv := map[int]int64{1: 1, 2: 2, 3: 3, 4: 4}

result := lo.FilterMapToSlice(kv, func(k int, v int64) (string, bool) {
    return fmt.Sprintf("%d_%d", k, v), k%2 == 0
})
// []{"2_2", "4_4"}
```

```go
kv := map[int]int64{1: 1, 2: 2, 3: 3, 4: 4}

result, err := lo.FilterMapToSliceErr(kv, func(k int, v int64) (string, bool, error) {
    if k == 3 {
        return "", false, fmt.Errorf("key 3 not allowed")
    }
    return fmt.Sprintf("%d_%d", k, v), k%2 == 0, nil
})
// []string(nil), error("key 3 not allowed")
```

### FilterKeys

Transforms a map into a slice based on predicate returns true for specific elements. It is a mix of `lo.Filter()` and `lo.Keys()`.

```go
kv := map[int]string{1: "foo", 2: "bar", 3: "baz"}

result := FilterKeys(kv, func(k int, v string) bool {
    return v == "foo"
})
// [1]
```

```go
// Use FilterKeysErr when the predicate can return an error
result, err := lo.FilterKeysErr(map[int]string{1: "foo", 2: "bar", 3: "baz"}, func(k int, v string) (bool, error) {
    if k == 3 {
        return false, fmt.Errorf("key 3 not allowed")
    }
    return v == "foo", nil
})
// []int(nil), error("key 3 not allowed")
```

[[play](https://go.dev/play/p/OFlKXlPrBAe)]

### FilterValues

Transforms a map into a slice based on predicate returns true for specific elements. It is a mix of `lo.Filter()` and `lo.Values()`.

```go
kv := map[int]string{1: "foo", 2: "bar", 3: "baz"}

result := FilterValues(kv, func(k int, v string) bool {
    return v == "foo"
})
// ["foo"]
```

```go
// Use FilterValuesErr when the predicate can return an error
result, err := lo.FilterValuesErr(map[int]string{1: "foo", 2: "bar", 3: "baz"}, func(k int, v string) (bool, error) {
    if k == 3 {
        return false, fmt.Errorf("key 3 not allowed")
    }
    return v == "foo", nil
})
// []string(nil), error("key 3 not allowed")
```

[[play](https://go.dev/play/p/YVD5r_h-LX-)]

### Range / RangeFrom / RangeWithSteps

Creates a slice of numbers (positive and/or negative) progressing from start up to, but not including end.

```go
result := lo.Range(4)
// [0, 1, 2, 3]

result := lo.Range(-4)
// [0, -1, -2, -3]

result := lo.RangeFrom(1, 5)
// [1, 2, 3, 4, 5]

result := lo.RangeFrom[float64](1.0, 5)
// [1.0, 2.0, 3.0, 4.0, 5.0]

result := lo.RangeWithSteps(0, 20, 5)
// [0, 5, 10, 15]

result := lo.RangeWithSteps[float32](-1.0, -4.0, -1.0)
// [-1.0, -2.0, -3.0]

result := lo.RangeWithSteps(1, 4, -1)
// []

result := lo.Range(0)
// []
```

[[play](https://go.dev/play/p/0r6VimXAi9H)]

### Clamp

Clamps number within the inclusive lower and upper bounds.

```go
r1 := lo.Clamp(0, -10, 10)
// 0

r2 := lo.Clamp(-42, -10, 10)
// -10

r3 := lo.Clamp(42, -10, 10)
// 10
```

[[play](https://go.dev/play/p/RU4lJNC2hlI)]

### Sum

Sums the values in a collection.

If collection is empty 0 is returned.

```go
list := []int{1, 2, 3, 4, 5}
sum := lo.Sum(list)
// 15
```

[[play](https://go.dev/play/p/upfeJVqs4Bt)]

### SumBy

Summarizes the values in a collection using the given return value from the iteration function.

If collection is empty 0 is returned.

```go
strings := []string{"foo", "bar"}
sum := lo.SumBy(strings, func(item string) int {
    return len(item)
})
// 6
```

With error handling:

```go
strings := []string{"foo", "bar", "baz"}
sum, err := lo.SumByErr(strings, func(item string) (int, error) {
    if item == "bar" {
        return 0, fmt.Errorf("invalid item: %s", item)
    }
    return len(item), nil
})
// sum: 3, err: invalid item: bar
```

### Product

Calculates the product of the values in a collection.

If collection is empty 0 is returned.

```go
list := []int{1, 2, 3, 4, 5}
product := lo.Product(list)
// 120
```

[[play](https://go.dev/play/p/2_kjM_smtAH)]

### ProductBy

Calculates the product of the values in a collection using the given return value from the iteration function.

If collection is empty 0 is returned.

```go
strings := []string{"foo", "bar"}
product := lo.ProductBy(strings, func(item string) int {
    return len(item)
})
// 9
```

```go
// Use ProductByErr when the transform function can return an error
strings := []string{"foo", "bar", "baz"}
product, err := lo.ProductByErr(strings, func(item string) (int, error) {
    if item == "bar" {
        return 0, fmt.Errorf("bar is not allowed")
    }
    return len(item), nil
})
// 3, error("bar is not allowed")
```

[[play](https://go.dev/play/p/wadzrWr9Aer)]

### Mean

Calculates the mean of a collection of numbers.

If collection is empty 0 is returned.

```go
mean := lo.Mean([]int{2, 3, 4, 5})
// 3

mean := lo.Mean([]float64{2, 3, 4, 5})
// 3.5

mean := lo.Mean([]float64{})
// 0
```

### MeanBy

Calculates the mean of a collection of numbers using the given return value from the iteration function.

If collection is empty 0 is returned.

```go
list := []string{"aa", "bbb", "cccc", "ddddd"}
mapper := func(item string) float64 {
    return float64(len(item))
}

mean := lo.MeanBy(list, mapper)
// 3.5

mean := lo.MeanBy([]float64{}, mapper)
// 0
```

```go
// Use MeanByErr when the transform function can return an error
list := []string{"aa", "bbb", "cccc", "ddddd"}
mean, err := lo.MeanByErr(list, func(item string) (float64, error) {
    if item == "cccc" {
        return 0, fmt.Errorf("cccc is not allowed")
    }
    return float64(len(item)), nil
})
// 0, error("cccc is not allowed")
```

[[play](https://go.dev/play/p/j7TsVwBOZ7P)]

### Mode

Calculates the mode (most frequent value) of a collection of numbers.

If multiple values have the same highest frequency, then multiple values are returned.

If the collection is empty, the zero value of `T[]` is returned.

```go
mode := lo.Mode([]int{2, 2, 3, 4})
// [2]

mode := lo.Mode([]float64{2, 2, 3, 3})
// [2, 3]

mode := lo.Mode([]float64{})
// []

mode := lo.Mode([]int{1, 2, 3, 4, 5, 6, 7, 8, 9})
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
```

### RandomString

Returns a random string of the specified length and made of the specified charset.

```go
str := lo.RandomString(5, lo.LettersCharset)
// example: "eIGbt"
```

[[play](https://go.dev/play/p/rRseOQVVum4)]

### Substring

Return part of a string.

```go
sub := lo.Substring("hello", 2, 3)
// "llo"

sub := lo.Substring("hello", -4, 3)
// "ell"

sub := lo.Substring("hello", -2, math.MaxUint)
// "lo"
```

[[play](https://go.dev/play/p/TQlxQi82Lu1)]

### ChunkString

Returns a slice of strings split into groups of length size. If the string can't be split evenly, the final chunk will be the remaining characters.

```go
lo.ChunkString("123456", 2)
// []string{"12", "34", "56"}

lo.ChunkString("1234567", 2)
// []string{"12", "34", "56", "7"}

lo.ChunkString("", 2)
// []string{""}

lo.ChunkString("1", 2)
// []string{"1"}
```

Note: `lo.ChunkString` and `lo.Chunk` functions behave inconsistently for empty input: `lo.ChunkString("", n)` returns `[""]` instead of `[]`. See [#788](https://github.com/samber/lo/issues/788).

[[play](https://go.dev/play/p/__FLTuJVz54)]

### RuneLength

An alias to utf8.RuneCountInString which returns the number of runes in string.

```go
sub := lo.RuneLength("hellô")
// 5

sub := len("hellô")
// 6
```

[[play](https://go.dev/play/p/tuhgW_lWY8l)]

### PascalCase

Converts string to pascal case.

```go
str := lo.PascalCase("hello_world")
// HelloWorld
```

[[play](https://go.dev/play/p/Dy_V_6DUYhe)]

### CamelCase

Converts string to camel case.

```go
str := lo.CamelCase("hello_world")
// helloWorld
```

[[play](https://go.dev/play/p/Go6aKwUiq59)]

### KebabCase

Converts string to kebab case.

```go
str := lo.KebabCase("helloWorld")
// hello-world
```

[[play](https://go.dev/play/p/96gT_WZnTVP)]

### SnakeCase

Converts string to snake case.

```go
str := lo.SnakeCase("HelloWorld")
// hello_world
```

[[play](https://go.dev/play/p/ziB0V89IeVH)]

### Words

Splits string into a slice of its words.

```go
str := lo.Words("helloWorld")
// []string{"hello", "world"}
```

[[play](https://go.dev/play/p/-f3VIQqiaVw)]

### Capitalize

Converts the first character of string to upper case and the remaining to lower case.

```go
str := lo.Capitalize("heLLO")
// Hello
```

[[play](https://go.dev/play/p/uLTZZQXqnsa)]

### Ellipsis

Trims and truncates a string to a specified length in runes (Unicode code points) and appends an ellipsis if truncated. Multi-byte characters such as emoji or CJK ideographs are never split in the middle.

```go
str := lo.Ellipsis("  Lorem Ipsum  ", 5)
// Lo...

str := lo.Ellipsis("Lorem Ipsum", 100)
// Lorem Ipsum

str := lo.Ellipsis("Lorem Ipsum", 3)
// ...

str := lo.Ellipsis("hello 世界! 你好", 8)
// hello...

str := lo.Ellipsis("🏠🐶🐱🌟", 4)
// 🏠🐶🐱🌟
```

[[play](https://go.dev/play/p/qE93rgqe1TW)]

### T2 -> T9

Creates a tuple from a list of values.

```go
tuple1 := lo.T2("x", 1)
// Tuple2[string, int]{A: "x", B: 1}

func example() (string, int) { return "y", 2 }
tuple2 := lo.T2(example())
// Tuple2[string, int]{A: "y", B: 2}
```

[[play](https://go.dev/play/p/IllL3ZO4BQm)]

### Unpack2 -> Unpack9

Returns values contained in a tuple.

```go
r1, r2 := lo.Unpack2(lo.Tuple2[string, int]{"a", 1})
// "a", 1
```

Unpack is also available as a method of TupleX.

```go
tuple2 := lo.T2("a", 1)
a, b := tuple2.Unpack()
// "a", 1
```

[[play](https://go.dev/play/p/xVP_k0kJ96W)]

### Zip2 -> Zip9

Zip creates a slice of grouped elements, the first of which contains the first elements of the given slices, the second of which contains the second elements of the given slices, and so on.

When collections are different sizes, the Tuple attributes are filled with zero value.

```go
tuples := lo.Zip2([]string{"a", "b"}, []int{1, 2})
// []Tuple2[string, int]{{A: "a", B: 1}, {A: "b", B: 2}}
```

[[play](https://go.dev/play/p/jujaA6GaJTp)]

### ZipBy2 -> ZipBy9

ZipBy creates a slice of transformed elements, the first of which contains the first elements of the given slices, the second of which contains the second elements of the given slices, and so on.

When collections are different sizes, the Tuple attributes are filled with zero value.

```go
items := lo.ZipBy2([]string{"a", "b"}, []int{1, 2}, func(a string, b int) string {
    return fmt.Sprintf("%s-%d", a, b)
})
// []string{"a-1", "b-2"}
```

With error handling:

```go
items, err := lo.ZipByErr2([]string{"a", "b"}, []int{1, 2}, func(a string, b int) (string, error) {
    if b == 2 {
        return "", fmt.Errorf("number 2 is not allowed")
    }
    return fmt.Sprintf("%s-%d", a, b), nil
})
// []string(nil), error("number 2 is not allowed")
```

### Unzip2 -> Unzip9

Unzip accepts a slice of grouped elements and creates a slice regrouping the elements to their pre-zip configuration.

```go
a, b := lo.Unzip2([]Tuple2[string, int]{{A: "a", B: 1}, {A: "b", B: 2}})
// []string{"a", "b"}
// []int{1, 2}
```

[[play](https://go.dev/play/p/ciHugugvaAW)]

### UnzipBy2 -> UnzipBy9

UnzipBy2 iterates over a collection and creates a slice regrouping the elements to their pre-zip configuration.

```go
a, b := lo.UnzipBy2([]string{"hello", "john", "doe"}, func(str string) (string, int) {
    return str, len(str)
})
// []string{"hello", "john", "doe"}
// []int{5, 4, 3}
```

```go
a, b, err := lo.UnzipByErr2([]string{"hello", "error", "world"}, func(str string) (string, int, error) {
    if str == "error" {
        return "", 0, fmt.Errorf("error string not allowed")
    }
    return str, len(str), nil
})
// []string{}
// []int{}
// error string not allowed
```

### CrossJoin2 -> CrossJoin9

Combines every item from one list with every item from others. It is the cartesian product of lists received as arguments. Returns an empty list if a list is empty.

```go
result := lo.CrossJoin2([]string{"hello", "john", "doe"}, []int{1, 2})
// lo.Tuple2{"hello", 1}
// lo.Tuple2{"hello", 2}
// lo.Tuple2{"john", 1}
// lo.Tuple2{"john", 2}
// lo.Tuple2{"doe", 1}
// lo.Tuple2{"doe", 2}
```

### CrossJoinBy2 -> CrossJoinBy9

Combines every item from one list with every item from others. It is the cartesian product of lists received as arguments. The transform function is used to create the output values. Returns an empty list if a list is empty.

```go
result := lo.CrossJoinBy2([]string{"hello", "john", "doe"}, []int{1, 2}, func(a A, b B) string {
    return fmt.Sprintf("%s - %d", a, b)
})
// "hello - 1"
// "hello - 2"
// "john - 1"
// "john - 2"
// "doe - 1"
// "doe - 2"
```

With error handling:

```go
result, err := lo.CrossJoinByErr2([]string{"hello", "john"}, []int{1, 2}, func(a string, b int) (string, error) {
    if a == "john" {
        return "", fmt.Errorf("john not allowed")
    }
    return fmt.Sprintf("%s - %d", a, b), nil
})
// []string(nil), error("john not allowed")
```

### Duration

Returns the time taken to execute a function.

```go
duration := lo.Duration(func() {
    // very long job
})
// 3s
```

[[play](https://go.dev/play/p/HQfbBbAXaFP)]

### Duration0 -> Duration10

Returns the time taken to execute a function.

```go
duration := lo.Duration0(func() {
    // very long job
})
// 3s

err, duration := lo.Duration1(func() error {
    // very long job
    return errors.New("an error")
})
// an error
// 3s

str, nbr, err, duration := lo.Duration3(func() (string, int, error) {
    // very long job
    return "hello", 42, nil
})
// hello
// 42
// nil
// 3s
```

### ChannelDispatcher

Distributes messages from input channels into N child channels. Close events are propagated to children.

Underlying channels can have a fixed buffer capacity or be unbuffered when cap is 0.

```go
ch := make(chan int, 42)
for i := 0; i <= 10; i++ {
    ch <- i
}

children := lo.ChannelDispatcher(ch, 5, 10, DispatchingStrategyRoundRobin[int])
// []<-chan int{...}

consumer := func(c <-chan int) {
    for {
        msg, ok := <-c
        if !ok {
            println("closed")

            break
        }

        println(msg)
    }
}

for i := range children {
    go consumer(children[i])
}
```

[[play](https://go.dev/play/p/UZGu2wVg3J2)]

Many distributions strategies are available:

- [lo.DispatchingStrategyRoundRobin](./channel.go): Distributes messages in a rotating sequential manner.
- [lo.DispatchingStrategyRandom](./channel.go): Distributes messages in a random manner.
- [lo.DispatchingStrategyWeightedRandom](./channel.go): Distributes messages in a weighted manner.
- [lo.DispatchingStrategyFirst](./channel.go): Distributes messages in the first non-full channel.
- [lo.DispatchingStrategyLeast](./channel.go): Distributes messages in the emptiest channel.
- [lo.DispatchingStrategyMost](./channel.go): Distributes to the fullest channel.

Some strategies bring fallback, in order to favor non-blocking behaviors. See implementations.

For custom strategies, just implement the `lo.DispatchingStrategy` prototype:

```go
type DispatchingStrategy[T any] func(message T, messageIndex uint64, channels []<-chan T) int
```

Eg:

```go
type Message struct {
    TenantID uuid.UUID
}

func hash(id uuid.UUID) int {
    h := fnv.New32a()
    h.Write([]byte(id.String()))
    return int(h.Sum32())
}

// Routes messages per TenantID.
customStrategy := func(message string, messageIndex uint64, channels []<-chan string) int {
    destination := hash(message) % len(channels)

    // check if channel is full
    if len(channels[destination]) < cap(channels[destination]) {
        return destination
    }

    // fallback when child channel is full
    return utils.DispatchingStrategyRoundRobin(message, uint64(destination), channels)
}

children := lo.ChannelDispatcher(ch, 5, 10, customStrategy)
...
```

### SliceToChannel

Returns a read-only channel of collection elements. Channel is closed after last element. Channel capacity can be customized.

```go
list := []int{1, 2, 3, 4, 5}

for v := range lo.SliceToChannel(2, list) {
    println(v)
}
// prints 1, then 2, then 3, then 4, then 5
```

[[play](https://go.dev/play/p/lIbSY3QmiEg)]

### ChannelToSlice

Returns a slice built from channel items. Blocks until channel closes.

```go
list := []int{1, 2, 3, 4, 5}
ch := lo.SliceToChannel(2, list)

items := ChannelToSlice(ch)
// []int{1, 2, 3, 4, 5}
```

### Generator

Implements the generator design pattern. Channel is closed after last element. Channel capacity can be customized.

```go
generator := func(yield func(int)) {
    yield(1)
    yield(2)
    yield(3)
}

for v := range lo.Generator(2, generator) {
    println(v)
}
// prints 1, then 2, then 3
```

### Buffer

Creates a slice of n elements from a channel. Returns the slice, the slice length, the read time and the channel status (opened/closed).

```go
ch := lo.SliceToChannel(2, []int{1, 2, 3, 4, 5})

items1, length1, duration1, ok1 := lo.Buffer(ch, 3)
// []int{1, 2, 3}, 3, 0s, true
items2, length2, duration2, ok2 := lo.Buffer(ch, 3)
// []int{4, 5}, 2, 0s, false
```

Example: RabbitMQ consumer 👇

```go
ch := readFromQueue()

for {
    // read 1k items
    items, length, _, ok := lo.Buffer(ch, 1000)

    // do batching stuff

    if !ok {
        break
    }
}
```

### BufferWithContext

Creates a slice of n elements from a channel, with timeout. Returns the slice, the slice length, the read time and the channel status (opened/closed).

```go
ctx, cancel := context.WithCancel(context.TODO())
go func() {
    ch <- 0
    time.Sleep(10*time.Millisecond)
    ch <- 1
    time.Sleep(10*time.Millisecond)
    ch <- 2
    time.Sleep(10*time.Millisecond)
    ch <- 3
    time.Sleep(10*time.Millisecond)
    ch <- 4
    time.Sleep(10*time.Millisecond)
    cancel()
}()

items1, length1, duration1, ok1 := lo.BufferWithContext(ctx, ch, 3)
// []int{0, 1, 2}, 3, 20ms, true
items2, length2, duration2, ok2 := lo.BufferWithContext(ctx, ch, 3)
// []int{3, 4}, 2, 30ms, false
```

### BufferWithTimeout

Creates a slice of n elements from a channel, with timeout. Returns the slice, the slice length, the read time and the channel status (opened/closed).

```go
generator := func(yield func(int)) {
    for i := 0; i < 5; i++ {
        yield(i)
        time.Sleep(35*time.Millisecond)
    }
}

ch := lo.Generator(0, generator)

items1, length1, duration1, ok1 := lo.BufferWithTimeout(ch, 3, 100*time.Millisecond)
// []int{1, 2}, 2, 100ms, true
items2, length2, duration2, ok2 := lo.BufferWithTimeout(ch, 3, 100*time.Millisecond)
// []int{3, 4, 5}, 3, 75ms, true
items3, length3, duration2, ok3 := lo.BufferWithTimeout(ch, 3, 100*time.Millisecond)
// []int{}, 0, 10ms, false
```

Example: RabbitMQ consumer 👇

```go
ch := readFromQueue()

for {
    // read 1k items
    // wait up to 1 second
    items, length, _, ok := lo.BufferWithTimeout(ch, 1000, 1*time.Second)

    // do batching stuff

    if !ok {
        break
    }
}
```

Example: Multithreaded RabbitMQ consumer 👇

```go
ch := readFromQueue()

// 5 workers
// prefetch 1k messages per worker
children := lo.ChannelDispatcher(ch, 5, 1000, lo.DispatchingStrategyFirst[int])

consumer := func(c <-chan int) {
    for {
        // read 1k items
        // wait up to 1 second
        items, length, _, ok := lo.BufferWithTimeout(ch, 1000, 1*time.Second)

        // do batching stuff

        if !ok {
            break
        }
    }
}

for i := range children {
    go consumer(children[i])
}
```

### FanIn

Merge messages from multiple input channels into a single buffered channel. Output messages have no priority. When all upstream channels reach EOF, downstream channel closes.

```go
stream1 := make(chan int, 42)
stream2 := make(chan int, 42)
stream3 := make(chan int, 42)

all := lo.FanIn(100, stream1, stream2, stream3)
// <-chan int
```

### FanOut

Broadcasts all the upstream messages to multiple downstream channels. When upstream channel reaches EOF, downstream channels close. If any downstream channels is full, broadcasting is paused.

```go
stream := make(chan int, 42)

all := lo.FanOut(5, 100, stream)
// [5]<-chan int
```

### Contains

Returns true if an element is present in a collection.

```go
present := lo.Contains([]int{0, 1, 2, 3, 4, 5}, 5)
// true
```

[[play](https://go.dev/play/p/W1EvyqY6t9j)]

### ContainsBy

Returns true if the predicate function returns `true`.

```go
present := lo.ContainsBy([]int{0, 1, 2, 3, 4, 5}, func(x int) bool {
    return x == 3
})
// true
```

### Every

Returns true if all elements of a subset are contained in a collection or if the subset is empty.

```go
ok := lo.Every([]int{0, 1, 2, 3, 4, 5}, []int{0, 2})
// true

ok := lo.Every([]int{0, 1, 2, 3, 4, 5}, []int{0, 6})
// false
```

### EveryBy

Returns true if the predicate returns true for all elements in the collection or if the collection is empty.

```go
b := EveryBy([]int{1, 2, 3, 4}, func(x int) bool {
    return x < 5
})
// true
```

[[play](https://go.dev/play/p/dn1-vhHsq9x)]

### Some

Returns true if at least 1 element of a subset is contained in a collection.
If the subset is empty Some returns false.

```go
ok := lo.Some([]int{0, 1, 2, 3, 4, 5}, []int{0, 6})
// true
```

[[play](https://go.dev/play/p/Lj4ceFkeT9V)]

ok := lo.Some([]int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
// false
```

### SomeBy

Returns true if the predicate returns true for any of the elements in the collection.
If the collection is empty SomeBy returns false.

```go
b := SomeBy([]int{1, 2, 3, 4}, func(x int) bool {
    return x < 3
})
// true
```

### None

Returns true if no element of a subset is contained in a collection or if the subset is empty.

```go
b := None([]int{0, 1, 2, 3, 4, 5}, []int{0, 2})
// false
b := None([]int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
// true
```

[[play](https://go.dev/play/p/fye7JsmxzPV)]

### NoneBy

Returns true if the predicate returns true for none of the elements in the collection or if the collection is empty.

```go
b := NoneBy([]int{1, 2, 3, 4}, func(x int) bool {
    return x < 0
})
// true
```

[[play](https://go.dev/play/p/O64WZ32H58S)]

### Intersect

Returns the intersection between collections.

```go
result1 := lo.Intersect([]int{0, 1, 2, 3, 4, 5}, []int{0, 2})
// []int{0, 2}

result2 := lo.Intersect([]int{0, 1, 2, 3, 4, 5}, []int{0, 6})
// []int{0}

result3 := lo.Intersect([]int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
// []int{}

result4 := lo.Intersect([]int{0, 3, 5, 7}, []int{3, 5}, []int{0, 1, 2, 0, 3, 0})
// []int{3}
```

### IntersectBy

Returns the intersection between two collections using a custom key selector function.

```go
transform := func(v int) string {
    return strconv.Itoa(v)
}

result1 := lo.IntersectBy(transform, []int{0, 1, 2, 3, 4, 5}, []int{0, 2})
// []int{0, 2}

result2 := lo.IntersectBy(transform, []int{0, 1, 2, 3, 4, 5}, []int{0, 6})
// []int{0}

result3 := lo.IntersectBy(transform, []int{0, 1, 2, 3, 4, 5}, []int{-1, 6})
// []int{}

result4 := lo.IntersectBy(transform, []int{0, 3, 5, 7}, []int{3, 5}, []int{0, 1, 2, 0, 3, 0})
// []int{3}
```

### Difference

Returns the difference between two collections.

- The first value is the collection of elements absent from list2.
- The second value is the collection of elements absent from list1.

```go
left, right := lo.Difference([]int{0, 1, 2, 3, 4, 5}, []int{0, 2, 6})
// []int{1, 3, 4, 5}, []int{6}

left, right := lo.Difference([]int{0, 1, 2, 3, 4, 5}, []int{0, 1, 2, 3, 4, 5})
// []int{}, []int{}
```

[[play](https://go.dev/play/p/pKE-JgzqRpz)]

### Union

Returns all distinct elements from given collections. Result will not change the order of elements relatively.

```go
union := lo.Union([]int{0, 1, 2, 3, 4, 5}, []int{0, 2}, []int{0, 10})
// []int{0, 1, 2, 3, 4, 5, 10}
```

### Without

Returns a slice excluding all given values.

```go
subset := lo.Without([]int{0, 2, 10}, 2)
// []int{0, 10}

subset := lo.Without([]int{0, 2, 10}, 0, 1, 2, 3, 4, 5)
// []int{10}
```

### WithoutBy

Filters a slice by excluding elements whose extracted keys match any in the exclude list.

Returns a new slice containing only the elements whose keys are not in the exclude list.

```go
type User struct {
    ID int
    Name string
}

// original users
users := []User{
    {ID: 1, Name: "Alice"},
    {ID: 2, Name: "Bob"},
    {ID: 3, Name: "Charlie"},
}

// extract function to get the user ID
getID := func(user User) int {
    return user.ID
}

// exclude users with IDs 2 and 3
excludedIDs := []int{2, 3}

// filtering users
filteredUsers := lo.WithoutBy(users, getID, excludedIDs...)
// []User[{ID: 1, Name: "Alice"}]
```

```go
// Use WithoutByErr when the iteratee can return an error
type struct User {
    ID int
    Name string
}

users := []User{
    {ID: 1, Name: "Alice"},
    {ID: 2, Name: "Bob"},
    {ID: 3, Name: "Charlie"},
}

getID := func(user User) (int, error) {
    if user.ID == 2 {
        return 0, fmt.Errorf("Bob not allowed")
    }
    return user.ID, nil
}

filteredUsers, err := lo.WithoutByErr(users, getID, 2, 3)
// []User(nil), error("Bob not allowed")
```

### WithoutEmpty

Returns a slice excluding zero values.

```go
subset := lo.WithoutEmpty([]int{0, 2, 10})
// []int{2, 10}
```

### WithoutNth

Returns a slice excluding the nth value.

```go
subset := lo.WithoutNth([]int{-2, -1, 0, 1, 2}, 3, -42, 1)
// []int{-2, 0, 2}
```

### ElementsMatch

Returns true if lists contain the same set of elements (including empty set).

If there are duplicate elements, the number of occurrences in each list should match.

The order of elements is not checked.

```go
b := lo.ElementsMatch([]int{1, 1, 2}, []int{2, 1, 1})
// true
```

### ElementsMatchBy

Returns true if lists contain the same set of elements' keys (including empty set).

If there are duplicate keys, the number of occurrences in each list should match.

The order of elements is not checked.

```go
b := lo.ElementsMatchBy(
    []someType{a, b},
    []someType{b, a},
    func(item someType) string { return item.ID() },
)
// true
```

### IndexOf

Returns the index at which the first occurrence of a value is found in a slice or -1 if the value cannot be found.

```go
found := lo.IndexOf([]int{0, 1, 2, 1, 2, 3}, 2)
// 2

notFound := lo.IndexOf([]int{0, 1, 2, 1, 2, 3}, 6)
// -1
```

[[play](https://go.dev/play/p/Eo7W0lvKTky)]

### LastIndexOf

Returns the index at which the last occurrence of a value is found in a slice or -1 if the value cannot be found.

```go
found := lo.LastIndexOf([]int{0, 1, 2, 1, 2, 3}, 2)
// 4

notFound := lo.LastIndexOf([]int{0, 1, 2, 1, 2, 3}, 6)
// -1
```

### HasPrefix

Returns true if the collection has the prefix.

```go
ok := lo.HasPrefix([]int{1, 2, 3, 4}, []int{42})
// false

ok := lo.HasPrefix([]int{1, 2, 3, 4}, []int{1, 2})
// true
```

[[play](https://go.dev/play/p/SrljzVDpMQM)]

### HasSuffix

Returns true if the collection has the suffix.

```go
ok := lo.HasSuffix([]int{1, 2, 3, 4}, []int{42})
// false

ok := lo.HasSuffix([]int{1, 2, 3, 4}, []int{3, 4})
// true
```

[[play](https://go.dev/play/p/bJeLetQNAON)]

### Find

Searches for an element in a slice based on a predicate. Returns element and true if element was found.

```go
str, ok := lo.Find([]string{"a", "b", "c", "d"}, func(i string) bool {
    return i == "b"
})
// "b", true

str, ok := lo.Find([]string{"foobar"}, func(i string) bool {
    return i == "b"
})
// "", false
```

```go
// Use FindErr when the predicate can return an error
str, err := lo.FindErr([]string{"a", "b", "c", "d"}, func(i string) (bool, error) {
    if i == "c" {
        return false, fmt.Errorf("c is not allowed")
    }
    return i == "b", nil
})
// "b", nil

str, err = lo.FindErr([]string{"a", "b", "c"}, func(i string) (bool, error) {
    if i == "b" {
        return false, fmt.Errorf("b is not allowed")
    }
    return i == "b", nil
})
// "", error("b is not allowed")
```

[[play](https://go.dev/play/p/Eo7W0lvKTky)]

### FindIndexOf

FindIndexOf searches for an element in a slice based on a predicate and returns the index and true. Returns -1 and false if the element is not found.

```go
str, index, ok := lo.FindIndexOf([]string{"a", "b", "a", "b"}, func(i string) bool {
    return i == "b"
})
// "b", 1, true

str, index, ok := lo.FindIndexOf([]string{"foobar"}, func(i string) bool {
    return i == "b"
})
// "", -1, false
```

[[play](https://go.dev/play/p/XWSEM4Ic_t0)]

### FindLastIndexOf

FindLastIndexOf searches for the last element in a slice based on a predicate and returns the index and true. Returns -1 and false if the element is not found.

```go
str, index, ok := lo.FindLastIndexOf([]string{"a", "b", "a", "b"}, func(i string) bool {
    return i == "b"
})
// "b", 4, true

str, index, ok := lo.FindLastIndexOf([]string{"foobar"}, func(i string) bool {
    return i == "b"
})
// "", -1, false
```

[[play](https://go.dev/play/p/dPiMRtJ6cUx)]

### FindOrElse

Searches for an element in a slice based on a predicate. Returns the element if found or a given fallback value otherwise.

```go
str := lo.FindOrElse([]string{"a", "b", "c", "d"}, "x", func(i string) bool {
    return i == "b"
})
// "b"

str := lo.FindOrElse([]string{"foobar"}, "x", func(i string) bool {
    return i == "b"
})
// "x"
```

### FindKey

Returns the key of the first value matching.

```go
result1, ok1 := lo.FindKey(map[string]int{"foo": 1, "bar": 2, "baz": 3}, 2)
// "bar", true

result2, ok2 := lo.FindKey(map[string]int{"foo": 1, "bar": 2, "baz": 3}, 42)
// "", false

type test struct {
    foobar string
}
result3, ok3 := lo.FindKey(map[string]test{"foo": test{"foo"}, "bar": test{"bar"}, "baz": test{"baz"}}, test{"foo"})
// "foo", true
```

### FindKeyBy

Returns the key of the first element predicate returns true for.

```go
result1, ok1 := lo.FindKeyBy(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(k string, v int) bool {
    return k == "foo"
})
// "foo", true

result2, ok2 := lo.FindKeyBy(map[string]int{"foo": 1, "bar": 2, "baz": 3}, func(k string, v int) bool {
    return false
})
// "", false
```

### FindUniques

Returns a slice with all the elements that appear in the collection only once. The order of result values is determined by the order they occur in the slice.

```go
uniqueValues := lo.FindUniques([]int{1, 2, 2, 1, 2, 3})
// []int{3}
```

### FindUniquesBy

Returns a slice with all the elements that appear in the collection only once. The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is invoked for each element in the slice to generate the criterion by which uniqueness is computed.

```go
uniqueValues := lo.FindUniquesBy([]int{3, 4, 5, 6, 7}, func(i int) int {
    return i%3
})
// []int{5}
```

### FindDuplicates

Returns a slice with the first occurrence of each duplicated element in the collection. The order of result values is determined by the order they occur in the slice.

```go
duplicatedValues := lo.FindDuplicates([]int{1, 2, 2, 1, 2, 3})
// []int{1, 2}
```

### FindDuplicatesBy

Returns a slice with the first occurrence of each duplicated element in the collection. The order of result values is determined by the order they occur in the slice. It accepts `iteratee` which is invoked for each element in the slice to generate the criterion by which uniqueness is computed.

```go
duplicatedValues := lo.FindDuplicatesBy([]int{3, 4, 5, 6, 7}, func(i int) int {
    return i%3
})
// []int{3, 4}
```

With error handling:

```go
duplicatedValues, err := lo.FindDuplicatesByErr([]int{3, 4, 5, 6, 7}, func(i int) (int, error) {
    if i == 5 {
        return 0, fmt.Errorf("number 5 is not allowed")
    }
    return i % 3, nil
})
// []int(nil), error("number 5 is not allowed")
```

### Min

Search the minimum value of a collection.

Returns zero value when the collection is empty.

```go
min := lo.Min([]int{1, 2, 3})
// 1

min := lo.Min([]int{})
// 0

min := lo.Min([]time.Duration{time.Second, time.Hour})
// 1s
```

[[play](https://go.dev/play/p/r6e-Z8JozS8)]

### MinIndex

Search the minimum value of a collection and the index of the minimum value.

Returns (zero value, -1) when the collection is empty.

```go
min, index := lo.MinIndex([]int{1, 2, 3})
// 1, 0

min, index := lo.MinIndex([]int{})
// 0, -1

min, index := lo.MinIndex([]time.Duration{time.Second, time.Hour})
// 1s, 0
```

### MinBy

Search the minimum value of a collection using the given comparison function.

If several values of the collection are equal to the smallest value, returns the first such value.

Returns zero value when the collection is empty.

```go
min := lo.MinBy([]string{"s1", "string2", "s3"}, func(item string, min string) bool {
    return len(item) < len(min)
})
// "s1"

min := lo.MinBy([]string{}, func(item string, min string) bool {
    return len(item) < len(min)
})
// ""
```

```go
// Use MinByErr when the comparison function can return an error
min, err := lo.MinByErr([]string{"s1", "string2", "s3"}, func(item string, min string) (bool, error) {
    if item == "string2" {
        return false, fmt.Errorf("string2 is not allowed")
    }
    return len(item) < len(min), nil
})
// "s1", error("string2 is not allowed")
```

### MinIndexBy

Search the minimum value of a collection using the given comparison function and the index of the minimum value.

If several values of the collection are equal to the smallest value, returns the first such value.

Returns (zero value, -1) when the collection is empty.

```go
min, index := lo.MinIndexBy([]string{"s1", "string2", "s3"}, func(item string, min string) bool {
    return len(item) < len(min)
})
// "s1", 0

min, index := lo.MinIndexBy([]string{}, func(item string, min string) bool {
    return len(item) < len(min)
})
// "", -1
```

```go
min, index, err := lo.MinIndexByErr([]string{"s1", "string2", "s3"}, func(item string, min string) (bool, error) {
    if item == "s2" {
        return false, fmt.Errorf("s2 is not allowed")
    }
    return len(item) < len(min), nil
})
// "s1", 0, error("s2 is not allowed")
```

### Earliest

Search the minimum time.Time of a collection.

Returns zero value when the collection is empty.

```go
earliest := lo.Earliest(time.Now(), time.Time{})
// 0001-01-01 00:00:00 +0000 UTC
```

### EarliestBy

Search the minimum time.Time of a collection using the given iteratee function.

Returns zero value when the collection is empty.

```go
type foo struct {
    bar time.Time
}

earliest := lo.EarliestBy([]foo{{time.Now()}, {}}, func(i foo) time.Time {
    return i.bar
})
// {bar:{2023-04-01 01:02:03 +0000 UTC}}
```

```go
// Use EarliestByErr when the iteratee function can return an error
earliest, err := lo.EarliestByErr([]foo{{time.Now()}, {}}, func(i foo) (time.Time, error) {
    if i.bar.IsZero() {
        return time.Time{}, fmt.Errorf("zero time not allowed")
    }
    return i.bar, nil
})
// {bar:{...}}, error("zero time not allowed")
```

### Max

Search the maximum value of a collection.

Returns zero value when the collection is empty.

```go
max := lo.Max([]int{1, 2, 3})
// 3

max := lo.Max([]int{})
// 0

max := lo.Max([]time.Duration{time.Second, time.Hour})
// 1h
```

### MaxIndex

Search the maximum value of a collection and the index of the maximum value.

Returns (zero value, -1) when the collection is empty.

```go
max, index := lo.MaxIndex([]int{1, 2, 3})
// 3, 2

max, index := lo.MaxIndex([]int{})
// 0, -1

max, index := lo.MaxIndex([]time.Duration{time.Second, time.Hour})
// 1h, 1
```

### MaxBy

Search the maximum value of a collection using the given comparison function.

If several values of the collection are equal to the greatest value, returns the first such value.

Returns zero value when the collection is empty.

```go
max := lo.MaxBy([]string{"string1", "s2", "string3"}, func(item string, max string) bool {
    return len(item) > len(max)
})
// "string1"

max := lo.MaxBy([]string{}, func(item string, max string) bool {
    return len(item) > len(max)
})
// ""
```

```go
// Use MaxByErr when the comparison function can return an error
max, err := lo.MaxByErr([]string{"string1", "s2", "string3"}, func(item string, max string) (bool, error) {
    if item == "s2" {
        return false, fmt.Errorf("s2 is not allowed")
    }
    return len(item) > len(max), nil
})
// "string1", error("s2 is not allowed")
```

[[play](https://go.dev/play/p/JW1qu-ECwF7)]

### MaxIndexBy

Search the maximum value of a collection using the given comparison function and the index of the maximum value.

If several values of the collection are equal to the greatest value, returns the first such value.

Returns (zero value, -1) when the collection is empty.

```go
max, index := lo.MaxIndexBy([]string{"string1", "s2", "string3"}, func(item string, max string) bool {
    return len(item) > len(max)
})
// "string1", 0

max, index := lo.MaxIndexBy([]string{}, func(item string, max string) bool {
    return len(item) > len(max)
})
// "", -1
```

```go
// Use MaxIndexByErr when the comparison function can return an error
max, index, err := lo.MaxIndexByErr([]string{"string1", "s2", "string3"}, func(item string, max string) (bool, error) {
    if item == "s2" {
        return false, fmt.Errorf("s2 is not allowed")
    }
    return len(item) > len(max), nil
})
// "string1", 0, error("s2 is not allowed")
```

[[play](https://go.dev/play/p/uaUszc-c9QK)]

### Latest

Search the maximum time.Time of a collection.

Returns zero value when the collection is empty.

```go
latest := lo.Latest(time.Now(), time.Time{})
// 2023-04-01 01:02:03 +0000 UTC
```

### LatestBy

Search the maximum time.Time of a collection using the given iteratee function.

Returns zero value when the collection is empty.

```go
type foo struct {
    bar time.Time
}

latest := lo.LatestBy([]foo{{time.Now()}, {}}, func(i foo) time.Time {
    return i.bar
})
// {bar:{2023-04-01 01:02:03 +0000 UTC}}
```

```go
// Use LatestByErr when the iteratee function can return an error
result, err := lo.LatestByErr([]foo{{time.Now()}, {}}, func(i foo) (time.Time, error) {
    if i.bar.IsZero() {
        return time.Time{}, fmt.Errorf("zero time not allowed")
    }
    return i.bar, nil
})
// foo{}, error("zero time not allowed")
```

### First

Returns the first element of a collection and check for availability of the first element.

```go
first, ok := lo.First([]int{1, 2, 3})
// 1, true

first, ok := lo.First([]int{})
// 0, false
```

### FirstOrEmpty

Returns the first element of a collection or zero value if empty.

```go
first := lo.FirstOrEmpty([]int{1, 2, 3})
// 1

first := lo.FirstOrEmpty([]int{})
// 0
```

### FirstOr

Returns the first element of a collection or the fallback value if empty.

```go
first := lo.FirstOr([]int{1, 2, 3}, 245)
// 1

first := lo.FirstOr([]int{}, 31)
// 31
```

### Last

Returns the last element of a collection or error if empty.

```go
last, ok := lo.Last([]int{1, 2, 3})
// 3
// true

last, ok := lo.Last([]int{})
// 0
// false
```

### LastOrEmpty

Returns the last element of a collection or zero value if empty.

```go
last := lo.LastOrEmpty([]int{1, 2, 3})
// 3

last := lo.LastOrEmpty([]int{})
// 0
```

### LastOr

Returns the last element of a collection or the fallback value if empty.

```go
last := lo.LastOr([]int{1, 2, 3}, 245)
// 3

last := lo.LastOr([]int{}, 31)
// 31
```

### Nth

Returns the element at index `nth` of collection. If `nth` is negative, the nth element from the end is returned. An error is returned when nth is out of slice bounds.

```go
nth, err := lo.Nth([]int{0, 1, 2, 3}, 2)
// 2

nth, err := lo.Nth([]int{0, 1, 2, 3}, -2)
// 2
```

### NthOr

Returns the element at index `nth` of the collection. If `nth` is negative, it returns the `nth` element from the end. If `nth` is out of slice bounds, it returns the provided fallback value
```go
nth := lo.NthOr([]int{10, 20, 30, 40, 50}, 2, -1)
// 30

nth := lo.NthOr([]int{10, 20, 30, 40, 50}, -1, -1)
// 50

nth := lo.NthOr([]int{10, 20, 30, 40, 50}, 5, -1)
// -1 (fallback value)
```

### NthOrEmpty

Returns the element at index `nth` of the collection. If `nth` is negative, it returns the `nth` element from the end. If `nth` is out of slice bounds, it returns the zero value for the element type (e.g., 0 for integers, "" for strings, etc).
``` go
nth := lo.NthOrEmpty([]int{10, 20, 30, 40, 50}, 2)
// 30

nth := lo.NthOrEmpty([]int{10, 20, 30, 40, 50}, -1)
// 50

nth := lo.NthOrEmpty([]int{10, 20, 30, 40, 50}, 5)
// 0 (zero value for int)

nth := lo.NthOrEmpty([]string{"apple", "banana", "cherry"}, 2)
// "cherry"

nth := lo.NthOrEmpty([]string{"apple", "banana", "cherry"}, 5)
// "" (zero value for string)
```

### Sample

Returns a random item from collection.

```go
lo.Sample([]string{"a", "b", "c"})
// a random string from []string{"a", "b", "c"}

lo.Sample([]string{})
// ""
```

[[play](https://go.dev/play/p/FYA45LcpfM2)]

### SampleBy

Returns a random item from collection, using a given random integer generator.

```go
import "math/rand"

r := rand.New(rand.NewSource(42))
lo.SampleBy([]string{"a", "b", "c"}, r.Intn)
// a random string from []string{"a", "b", "c"}, using a seeded random generator

lo.SampleBy([]string{}, r.Intn)
// ""
```

### Samples

Returns N random unique items from collection.

```go
lo.Samples([]string{"a", "b", "c"}, 3)
// []string{"a", "b", "c"} in random order
```

### SamplesBy

Returns N random unique items from collection, using a given random integer generator.

```go
r := rand.New(rand.NewSource(42))
lo.SamplesBy([]string{"a", "b", "c"}, 3, r.Intn)
// []string{"a", "b", "c"} in random order, using a seeded random generator
```

### Ternary

A single line if/else statement.

```go
result := lo.Ternary(true, "a", "b")
// "a"

result := lo.Ternary(false, "a", "b")
// "b"
```

Take care to avoid dereferencing potentially nil pointers in your A/B expressions, because they are both evaluated. See TernaryF to avoid this problem.

[[play](https://go.dev/play/p/t-D7WBL44h2)]

### TernaryF

A single line if/else statement whose options are functions.

```go
result := lo.TernaryF(true, func() string { return "a" }, func() string { return "b" })
// "a"

result := lo.TernaryF(false, func() string { return "a" }, func() string { return "b" })
// "b"
```

Useful to avoid nil-pointer dereferencing in initializations, or avoid running unnecessary code

```go
var s *string

someStr := TernaryF(s == nil, func() string { return uuid.New().String() }, func() string { return *s })
// ef782193-c30c-4e2e-a7ae-f8ab5e125e02
```

[[play](https://go.dev/play/p/AO4VW20JoqM)]

### If / ElseIf / Else

```go
result := lo.If(true, 1).
    ElseIf(false, 2).
    Else(3)
// 1

result := lo.If(false, 1).
    ElseIf(true, 2).
    Else(3)
// 2

result := lo.If(false, 1).
    ElseIf(false, 2).
    Else(3)
// 3
```

Using callbacks:

```go
result := lo.IfF(true, func () int {
        return 1
    }).
    ElseIfF(false, func () int {
        return 2
    }).
    ElseF(func () int {
        return 3
    })
// 1
```

Mixed:

```go
result := lo.IfF(true, func () int {
        return 1
    }).
    Else(42)
// 1
```

[[play](https://go.dev/play/p/WSw3ApMxhyW)]

### Switch / Case / Default

```go
result := lo.Switch(1).
    Case(1, "1").
    Case(2, "2").
    Default("3")
// "1"

result := lo.Switch(2).
    Case(1, "1").
    Case(2, "2").
    Default("3")
// "2"

result := lo.Switch(42).
    Case(1, "1").
    Case(2, "2").
    Default("3")
// "3"
```

Using callbacks:

```go
result := lo.Switch(1).
    CaseF(1, func() string {
        return "1"
    }).
    CaseF(2, func() string {
        return "2"
    }).
    DefaultF(func() string {
        return "3"
    })
// "1"
```

Mixed:

```go
result := lo.Switch(1).
    CaseF(1, func() string {
        return "1"
    }).
    Default("42")
// "1"
```

[[play](https://go.dev/play/p/TGbKUMAeRUd)]

### IsNil

Checks if a value is nil or if it's a reference type with a nil underlying value.

```go
var x int
lo.IsNil(x)
// false

var k struct{}
lo.IsNil(k)
// false

var i *int
lo.IsNil(i)
// true

var ifaceWithNilValue any = (*string)(nil)
lo.IsNil(ifaceWithNilValue)
// true
ifaceWithNilValue == nil
// false
```

### IsNotNil

Checks if a value is not nil or if it's not a reference type with a nil underlying value.

```go
var x int
lo.IsNotNil(x)
// true

var k struct{}
lo.IsNotNil(k)
// true

var i *int
lo.IsNotNil(i)
// false

var ifaceWithNilValue any = (*string)(nil)
lo.IsNotNil(ifaceWithNilValue)
// false
ifaceWithNilValue == nil
// true
```

### ToPtr

Returns a pointer copy of the value.

```go
ptr := lo.ToPtr("hello world")
// *string{"hello world"}
```

[[play](https://go.dev/play/p/P2sD0PMXw4F)]

### Nil

Returns a nil pointer of type.

```go
ptr := lo.Nil[float64]()
// nil
```

### EmptyableToPtr

Returns a pointer copy of value if it's nonzero.
Otherwise, returns nil pointer.

```go
ptr := lo.EmptyableToPtr(nil)
// nil

ptr := lo.EmptyableToPtr("")
// nil

ptr := lo.EmptyableToPtr([]int{})
// *[]int{}

ptr := lo.EmptyableToPtr("hello world")
// *string{"hello world"}
```

### FromPtr

Returns the pointer value or empty.

```go
str := "hello world"
value := lo.FromPtr(&str)
// "hello world"

value := lo.FromPtr(nil)
// ""
```

### FromPtrOr

Returns the pointer value or the fallback value.

```go
str := "hello world"
value := lo.FromPtrOr(&str, "empty")
// "hello world"

value := lo.FromPtrOr(nil, "empty")
// "empty"
```

### ToSlicePtr

Returns a slice of pointers to each value.

```go
ptr := lo.ToSlicePtr([]string{"hello", "world"})
// []*string{"hello", "world"}
```

### FromSlicePtr

Returns a slice with the pointer values.
Returns a zero value in case of a nil pointer element.

```go
str1 := "hello"
str2 := "world"

ptr := lo.FromSlicePtr[string]([]*string{&str1, &str2, nil})
// []string{"hello", "world", ""}

ptr := lo.Compact(
    lo.FromSlicePtr[string]([]*string{&str1, &str2, nil}),
)
// []string{"hello", "world"}
```

### FromSlicePtrOr

Returns a slice with the pointer values or the fallback value.

```go
str1 := "hello"
str2 := "world"

ptr := lo.FromSlicePtrOr([]*string{&str1, nil, &str2}, "fallback value")
// []string{"hello", "fallback value", "world"}
```

[[play](https://go.dev/play/p/CuXGVzo9G65)]

### ToAnySlice

Returns a slice with all elements mapped to `any` type.

```go
elements := lo.ToAnySlice([]int{1, 5, 1})
// []any{1, 5, 1}
```

### FromAnySlice

Returns a slice with all elements mapped to a type. Returns false in case of type conversion failure.

```go
elements, ok := lo.FromAnySlice([]any{"foobar", 42})
// []string{}, false

elements, ok := lo.FromAnySlice([]any{"foobar", "42"})
// []string{"foobar", "42"}, true
```

### Empty

Returns the [zero value](https://go.dev/ref/spec#The_zero_value).

```go
lo.Empty[int]()
// 0
lo.Empty[string]()
// ""
lo.Empty[bool]()
// false
```

### IsEmpty

Returns true if argument is a zero value.

```go
lo.IsEmpty(0)
// true
lo.IsEmpty(42)
// false

lo.IsEmpty("")
// true
lo.IsEmpty("foobar")
// false

type test struct {
    foobar string
}

lo.IsEmpty(test{foobar: ""})
// true
lo.IsEmpty(test{foobar: "foobar"})
// false
```

### IsNotEmpty

Returns true if argument is a zero value.

```go
lo.IsNotEmpty(0)
// false
lo.IsNotEmpty(42)
// true

lo.IsNotEmpty("")
// false
lo.IsNotEmpty("foobar")
// true

type test struct {
    foobar string
}

lo.IsNotEmpty(test{foobar: ""})
// false
lo.IsNotEmpty(test{foobar: "foobar"})
// true
```

### Coalesce

Returns the first non-empty arguments. Arguments must be comparable.

```go
result, ok := lo.Coalesce(0, 1, 2, 3)
// 1 true

result, ok := lo.Coalesce("")
// "" false

var nilStr *string
str := "foobar"
result, ok := lo.Coalesce(nil, nilStr, &str)
// &"foobar" true
```

### CoalesceOrEmpty

Returns the first non-empty arguments. Arguments must be comparable.

```go
result := lo.CoalesceOrEmpty(0, 1, 2, 3)
// 1

result := lo.CoalesceOrEmpty("")
// ""

var nilStr *string
str := "foobar"
result := lo.CoalesceOrEmpty(nil, nilStr, &str)
// &"foobar"
```

### CoalesceSlice

Returns the first non-zero slice.

```go
result, ok := lo.CoalesceSlice([]int{1, 2, 3}, []int{4, 5, 6})
// [1, 2, 3]
// true

result, ok := lo.CoalesceSlice(nil, []int{})
// []
// true

result, ok := lo.CoalesceSlice([]int(nil))
// []
// false
```

### CoalesceSliceOrEmpty

Returns the first non-zero slice.

```go
result := lo.CoalesceSliceOrEmpty([]int{1, 2, 3}, []int{4, 5, 6})
// [1, 2, 3]

result := lo.CoalesceSliceOrEmpty(nil, []int{})
// []
```

### CoalesceMap

Returns the first non-zero map.

```go
result, ok := lo.CoalesceMap(map[string]int{"1": 1, "2": 2, "3": 3}, map[string]int{"4": 4, "5": 5, "6": 6})
// {"1": 1, "2": 2, "3": 3}
// true

result, ok := lo.CoalesceMap(nil, map[string]int{})
// {}
// true

result, ok := lo.CoalesceMap(map[string]int(nil))
// {}
// false
```

### CoalesceMapOrEmpty

Returns the first non-zero map.

```go
result := lo.CoalesceMapOrEmpty(map[string]int{"1": 1, "2": 2, "3": 3}, map[string]int{"4": 4, "5": 5, "6": 6})
// {"1": 1, "2": 2, "3": 3}

result := lo.CoalesceMapOrEmpty(nil, map[string]int{})
// {}
```

### Partial

Returns new function that, when called, has its first argument set to the provided value.

```go
add := func(x, y int) int { return x + y }
f := lo.Partial(add, 5)

f(10)
// 15

f(42)
// 47
```

[[play](https://go.dev/play/p/Sy1gAQiQZ3v)]

### Partial2 -> Partial5

Returns new function that, when called, has its first argument set to the provided value.

```go
add := func(x, y, z int) int { return x + y + z }
f := lo.Partial2(add, 42)

f(10, 5)
// 57

f(42, -4)
// 80
```

[[play](https://go.dev/play/p/-xiPjy4JChJ)]

### Attempt

Invokes a function N times until it returns valid output. Returns either the caught error or nil.

When the first argument is less than `1`, the function runs until a successful response is returned.

```go
iter, err := lo.Attempt(42, func(i int) error {
    if i == 5 {
        return nil
    }

    return errors.New("failed")
})
// 6
// nil

iter, err := lo.Attempt(2, func(i int) error {
    if i == 5 {
        return nil
    }

    return errors.New("failed")
})
// 2
// error "failed"

iter, err := lo.Attempt(0, func(i int) error {
    if i < 42 {
        return errors.New("failed")
    }

    return nil
})
// 43
// nil
```

For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).

[[play](https://go.dev/play/p/3ggJZ2ZKcMj)]

### AttemptWithDelay

Invokes a function N times until it returns valid output, with a pause between each call. Returns either the caught error or nil.

When the first argument is less than `1`, the function runs until a successful response is returned.

```go
iter, duration, err := lo.AttemptWithDelay(5, 2*time.Second, func(i int, duration time.Duration) error {
    if i == 2 {
        return nil
    }

    return errors.New("failed")
})
// 3
// ~ 4 seconds
// nil
```

For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).

[[play](https://go.dev/play/p/tVs6CygC7m1)]

### AttemptWhile

Invokes a function N times until it returns valid output. Returns either the caught error or nil, along with a bool value to determine whether the function should be invoked again. It will terminate the invoke immediately if the second return value is false.

When the first argument is less than `1`, the function runs until a successful response is returned.

```go
count1, err1 := lo.AttemptWhile(5, func(i int) (error, bool) {
    err := doMockedHTTPRequest(i)
    if err != nil {
        if errors.Is(err, ErrBadRequest) { // let's assume ErrBadRequest is a critical error that needs to terminate the invoke
            return err, false // flag the second return value as false to terminate the invoke
        }

        return err, true
    }

    return nil, false
})
```

For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).

[[play](https://go.dev/play/p/1VS7HxlYMOG)]

### AttemptWhileWithDelay

Invokes a function N times until it returns valid output, with a pause between each call. Returns either the caught error or nil, along with a bool value to determine whether the function should be invoked again. It will terminate the invoke immediately if the second return value is false.

When the first argument is less than `1`, the function runs until a successful response is returned.

```go
count1, time1, err1 := lo.AttemptWhileWithDelay(5, time.Millisecond, func(i int, d time.Duration) (error, bool) {
    err := doMockedHTTPRequest(i)
    if err != nil {
        if errors.Is(err, ErrBadRequest) { // let's assume ErrBadRequest is a critical error that needs to terminate the invoke
            return err, false // flag the second return value as false to terminate the invoke
        }

        return err, true
    }

    return nil, false
})
```

For more advanced retry strategies (delay, exponential backoff...), please take a look at [cenkalti/backoff](https://github.com/cenkalti/backoff).

[[play](https://go.dev/play/p/mhufUjJfLEF)]

### Debounce

`NewDebounce` creates a debounced instance that delays invoking functions given until after wait milliseconds have elapsed, until `cancel` is called.

```go
f := func() {
    println("Called once after 100ms when debounce stopped invoking!")
}

debounce, cancel := lo.NewDebounce(100 * time.Millisecond, f)
for j := 0; j < 10; j++ {
    debounce()
}

time.Sleep(1 * time.Second)
cancel()
```

[[play](https://go.dev/play/p/mz32VMK2nqe)]

### DebounceBy

`NewDebounceBy` creates a debounced instance for each distinct key, that delays invoking functions given until after wait milliseconds have elapsed, until `cancel` is called.

```go
f := func(key string, count int) {
    println(key + ": Called once after 100ms when debounce stopped invoking!")
}

debounce, cancel := lo.NewDebounceBy(100 * time.Millisecond, f)
for j := 0; j < 10; j++ {
    debounce("first key")
    debounce("second key")
}

time.Sleep(1 * time.Second)
cancel("first key")
cancel("second key")
```

[[play](https://go.dev/play/p/d3Vpt6pxhY8)]

### Throttle

Creates a throttled instance that invokes given functions only once in every interval.

This returns 2 functions, First one is throttled function and Second one is a function to reset interval.

```go
f := func() {
	println("Called once in every 100ms")
}

throttle, reset := lo.NewThrottle(100 * time.Millisecond, f)

for j := 0; j < 10; j++ {
	throttle()
	time.Sleep(30 * time.Millisecond)
}

reset()
throttle()
```

`NewThrottleWithCount` is NewThrottle with count limit, throttled function will be invoked count times in every interval.

```go
f := func() {
	println("Called three times in every 100ms")
}

throttle, reset := lo.NewThrottleWithCount(100 * time.Millisecond, f)

for j := 0; j < 10; j++ {
	throttle()
	time.Sleep(30 * time.Millisecond)
}

reset()
throttle()
```

`NewThrottleBy` and `NewThrottleByWithCount` are NewThrottle with sharding key, throttled function will be invoked count times in every interval.

```go
f := func(key string) {
	println(key, "Called three times in every 100ms")
}

throttle, reset := lo.NewThrottleByWithCount(100 * time.Millisecond, f)

for j := 0; j < 10; j++ {
	throttle("foo")
	time.Sleep(30 * time.Millisecond)
}

reset()
throttle()
```

### Synchronize

Wraps the underlying callback in a mutex. It receives an optional mutex.

```go
s := lo.Synchronize()

for i := 0; i < 10; i++ {
    go s.Do(func () {
        println("will be called sequentially")
    })
}
```

It is equivalent to:

```go
mu := sync.Mutex{}

func foobar() {
    mu.Lock()
    defer mu.Unlock()

    // ...
}
```

### Async

Executes a function in a goroutine and returns the result in a channel.

```go
ch := lo.Async(func() error { time.Sleep(10 * time.Second); return nil })
// chan error (nil)
```

### Async{0->6}

Executes a function in a goroutine and returns the result in a channel.
For functions with multiple return values, the results will be returned as a tuple inside the channel.
For functions without return, struct{} will be returned in the channel.

```go
ch := lo.Async0(func() { time.Sleep(10 * time.Second) })
// chan struct{}

ch := lo.Async1(func() int {
  time.Sleep(10 * time.Second);
  return 42
})
// chan int (42)

ch := lo.Async2(func() (int, string) {
  time.Sleep(10 * time.Second);
  return 42, "Hello"
})
// chan lo.Tuple2[int, string] ({42, "Hello"})
```

### Transaction

Implements a Saga pattern.

```go
transaction := NewTransaction().
    Then(
        func(state int) (int, error) {
            fmt.Println("step 1")
            return state + 10, nil
        },
        func(state int) int {
            fmt.Println("rollback 1")
            return state - 10
        },
    ).
    Then(
        func(state int) (int, error) {
            fmt.Println("step 2")
            return state + 15, nil
        },
        func(state int) int {
            fmt.Println("rollback 2")
            return state - 15
        },
    ).
    Then(
        func(state int) (int, error) {
            fmt.Println("step 3")

            if true {
                return state, errors.New("error")
            }

            return state + 42, nil
        },
        func(state int) int {
            fmt.Println("rollback 3")
            return state - 42
        },
    )

_, _ = transaction.Process(-5)

// Output:
// step 1
// step 2
// step 3
// rollback 2
// rollback 1
```

### WaitFor

Runs periodically until a condition is validated.

```go
alwaysTrue := func(i int) bool { return true }
alwaysFalse := func(i int) bool { return false }
laterTrue := func(i int) bool {
    return i > 5
}

iterations, duration, ok := lo.WaitFor(alwaysTrue, 10*time.Millisecond, 2 * time.Millisecond)
// 1
// 1ms
// true

iterations, duration, ok := lo.WaitFor(alwaysFalse, 10*time.Millisecond, time.Millisecond)
// 10
// 10ms
// false

iterations, duration, ok := lo.WaitFor(laterTrue, 10*time.Millisecond, time.Millisecond)
// 7
// 7ms
// true

iterations, duration, ok := lo.WaitFor(laterTrue, 10*time.Millisecond, 5*time.Millisecond)
// 2
// 10ms
// false
```

[[play](https://go.dev/play/p/t_wTDmubbK3)]

### WaitForWithContext

Runs periodically until a condition is validated or context is invalid.

The condition receives also the context, so it can invalidate the process in the condition checker

```go
ctx := context.Background()

alwaysTrue := func(_ context.Context, i int) bool { return true }
alwaysFalse := func(_ context.Context, i int) bool { return false }
laterTrue := func(_ context.Context, i int) bool {
    return i >= 5
}

iterations, duration, ok := lo.WaitForWithContext(ctx, alwaysTrue, 10*time.Millisecond, 2 * time.Millisecond)
// 1
// 1ms
// true

iterations, duration, ok := lo.WaitForWithContext(ctx, alwaysFalse, 10*time.Millisecond, time.Millisecond)
// 10
// 10ms
// false

iterations, duration, ok := lo.WaitForWithContext(ctx, laterTrue, 10*time.Millisecond, time.Millisecond)
// 5
// 5ms
// true

iterations, duration, ok := lo.WaitForWithContext(ctx, laterTrue, 10*time.Millisecond, 5*time.Millisecond)
// 2
// 10ms
// false

expiringCtx, cancel := context.WithTimeout(ctx, 5*time.Millisecond)
iterations, duration, ok := lo.WaitForWithContext(expiringCtx, alwaysFalse, 100*time.Millisecond, time.Millisecond)
// 5
// 5.1ms
// false
```

[[play](https://go.dev/play/p/t_wTDmubbK3)]

### Validate

Helper function that creates an error when a condition is not met.

```go
slice := []string{"a"}
val := lo.Validate(len(slice) == 0, "Slice should be empty but contains %v", slice)
// error("Slice should be empty but contains [a]")

slice := []string{}
val := lo.Validate(len(slice) == 0, "Slice should be empty but contains %v", slice)
// nil
```

[[play](https://go.dev/play/p/vPyh51XpCBt)]

### Must

Wraps a function call and panics if second argument is `error` or `false`, returns the value otherwise.

```go
val := lo.Must(time.Parse("2006-01-02", "2022-01-15"))
// 2022-01-15

val := lo.Must(time.Parse("2006-01-02", "bad-value"))
// panics
```

[[play](https://go.dev/play/p/TMoWrRp3DyC)]

### Must{0->6}

Must\* has the same behavior as Must but returns multiple values.

```go
func example0() (error)
func example1() (int, error)
func example2() (int, string, error)
func example3() (int, string, time.Date, error)
func example4() (int, string, time.Date, bool, error)
func example5() (int, string, time.Date, bool, float64, error)
func example6() (int, string, time.Date, bool, float64, byte, error)

lo.Must0(example0())
val1 := lo.Must1(example1())    // alias to Must
val1, val2 := lo.Must2(example2())
val1, val2, val3 := lo.Must3(example3())
val1, val2, val3, val4 := lo.Must4(example4())
val1, val2, val3, val4, val5 := lo.Must5(example5())
val1, val2, val3, val4, val5, val6 := lo.Must6(example6())
```

You can wrap functions like `func (...) (..., ok bool)`.

```go
// math.Signbit(float64) bool
lo.Must0(math.Signbit(v))

// bytes.Cut([]byte,[]byte) ([]byte, []byte, bool)
before, after := lo.Must2(bytes.Cut(s, sep))
```

You can give context to the panic message by adding some printf-like arguments.

```go
val, ok := lo.Find(myString, func(i string) bool {
    return i == requiredChar
})
lo.Must0(ok, "'%s' must always contain '%s'", myString, requiredChar)

list := []int{0, 1, 2}
item := 5
lo.Must0(lo.Contains(list, item), "'%s' must always contain '%s'", list, item)
...
```

[[play](https://go.dev/play/p/TMoWrRp3DyC)]

### Try

Calls the function and returns false in case of error and panic.

```go
ok := lo.Try(func() error {
    panic("error")
    return nil
})
// false

ok := lo.Try(func() error {
    return nil
})
// true

ok := lo.Try(func() error {
    return errors.New("error")
})
// false
```

[[play](https://go.dev/play/p/mTyyWUvn9u4)]

### Try{0->6}

The same behavior as `Try`, but the callback returns 2 variables.

```go
ok := lo.Try2(func() (string, error) {
    panic("error")
    return "", nil
})
// false
```

[[play](https://go.dev/play/p/mTyyWUvn9u4)]

### TryOr

Calls the function and return a default value in case of error and on panic.

```go
str, ok := lo.TryOr(func() (string, error) {
    panic("error")
    return "hello", nil
}, "world")
// world
// false

str, ok := lo.TryOr(func() error {
    return "hello", nil
}, "world")
// hello
// true

str, ok := lo.TryOr(func() error {
    return "hello", errors.New("error")
}, "world")
// world
// false
```

[[play](https://go.dev/play/p/B4F7Wg2Zh9X)]

### TryOr{0->6}

The same behavior as `TryOr`, but the callback returns `X` variables.

```go
str, nbr, ok := lo.TryOr2(func() (string, int, error) {
    panic("error")
    return "hello", 42, nil
}, "world", 21)
// world
// 21
// false
```

[[play](https://go.dev/play/p/B4F7Wg2Zh9X)]

### TryWithErrorValue

The same behavior as `Try`, but also returns the value passed to panic.

```go
err, ok := lo.TryWithErrorValue(func() error {
    panic("error")
    return nil
})
// "error", false
```

[[play](https://go.dev/play/p/Kc7afQIT2Fs)]

### TryCatch

The same behavior as `Try`, but calls the catch function in case of error.

```go
caught := false

ok := lo.TryCatch(func() error {
    panic("error")
    return nil
}, func() {
    caught = true
})
// false
// caught == true
```

[[play](https://go.dev/play/p/PnOON-EqBiU)]

### TryCatchWithErrorValue

The same behavior as `TryWithErrorValue`, but calls the catch function in case of error.

```go
caught := false

ok := lo.TryCatchWithErrorValue(func() error {
    panic("error")
    return nil
}, func(val any) {
    caught = val == "error"
})
// false
// caught == true
```

[[play](https://go.dev/play/p/8Pc9gwX_GZO)]

### ErrorsAs

A shortcut for:

```go
err := doSomething()

var rateLimitErr *RateLimitError
if ok := errors.As(err, &rateLimitErr); ok {
    // retry later
}
```

single line `lo` helper:

```go
err := doSomething()

if rateLimitErr, ok := lo.ErrorsAs[*RateLimitError](err); ok {
    // retry later
}
```

[[play](https://go.dev/play/p/8wk5rH8UfrE)]

### Assert

Does nothing when the condition is `true`, otherwise it panics with an optional message.

Think twice before using it, given that [Go intentionally omits assertions from its standard library](https://go.dev/doc/faq#assertions).

```go
age := getUserAge()

lo.Assert(age >= 15)
```

```go
age := getUserAge()

lo.Assert(age >= 15, "user age must be >= 15")
```

[[play](https://go.dev/play/p/Xv8LLKBMNwI)]

### Assertf

Like `Assert`, but with `fmt.Printf`-like formatting.

Think twice before using it, given that [Go intentionally omits assertions from its standard library](https://go.dev/doc/faq#assertions).

```go
age := getUserAge()

lo.Assertf(age >= 15, "user age must be >= 15, got %d", age)
```

[[play](https://go.dev/play/p/TVPEmVcyrdY)]

## 🛩 Benchmark

We executed a simple benchmark with a dead-simple `lo.Map` loop:

See the full implementation [here](./map_benchmark_test.go).

```go
_ = lo.Map[int64](arr, func(x int64, i int) string {
    return strconv.FormatInt(x, 10)
})
```

**Result:**

Here is a comparison between `lo.Map`, `lop.Map`, `go-funk` library and a simple Go `for` loop.

```shell
$ go test -benchmem -bench ./...
goos: linux
goarch: amd64
pkg: github.com/samber/lo
cpu: Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
cpu: Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
BenchmarkMap/lo.Map-8         	       8	 132728237 ns/op	39998945 B/op	 1000002 allocs/op
BenchmarkMap/lop.Map-8        	       2	 503947830 ns/op	119999956 B/op	 3000007 allocs/op
BenchmarkMap/reflect-8        	       2	 826400560 ns/op	170326512 B/op	 4000042 allocs/op
BenchmarkMap/for-8            	       9	 126252954 ns/op	39998674 B/op	 1000001 allocs/op
PASS
ok  	github.com/samber/lo	6.657s
```

- `lo.Map` is way faster (x7) than `go-funk`, a reflection-based Map implementation.
- `lo.Map` has the same allocation profile as `for`.
- `lo.Map` is 4% slower than `for`.
- `lop.Map` is slower than `lo.Map` because it implies more memory allocation and locks. `lop.Map` is useful for long-running callbacks, such as i/o bound processing.
- `for` beats other implementations for memory and CPU.

## 🤝 Contributing

- Ping me on Twitter [@samuelberthe](https://twitter.com/samuelberthe) (DMs, mentions, whatever :))
- Fork the [project](https://github.com/samber/lo)
- Fix [open issues](https://github.com/samber/lo/issues) or request new features

Don't hesitate ;)

Helper naming: helpers must be self-explanatory and respect standards (other languages, libraries...). Feel free to suggest many names in your contributions.

```bash
# Install some dev dependencies
make tools

# Run tests
make test
# or
make watch-test
```

## 👤 Contributors

![Contributors](https://contrib.rocks/image?repo=samber/lo)

## 💫 Show your support

Give a ⭐️ if this project helped you!

[![GitHub Sponsors](https://img.shields.io/github/sponsors/samber?style=for-the-badge)](https://github.com/sponsors/samber)

## 📝 License

Copyright © 2022 [Samuel Berthe](https://github.com/samber).

This project is under [MIT](./LICENSE) license.


================================================
FILE: benchmark/CLAUDE.md
================================================
# Benchmark Guidelines

## File Organization

Benchmark files follow the naming convention:

```
benchmark/{package}_{category}_bench_test.go
```

- **package**: `core`, `it`, `mutable`, `parallel`
- **category**: `slice`, `map`, `find`, `intersect`, `math`, `string`, `type_manipulation`, `condition`, `tuples`

Shared data generators live in `helpers_test.go` (and `it_helpers_test.go` for `go1.23` iter helpers).

## Performance PRs

Every performance improvement PR **must** include a `benchstat` comparison in the PR description. Without before/after numbers, the PR will not be merged.

### How to produce a benchstat report

1. Check out `master` and run the "before" benchmarks:
   ```bash
   git stash && git switch master
   go test ./benchmark/... -bench=BenchmarkXxx -benchmem -count=6 -cpu=1 | tee /tmp/before.txt
   ```

2. Switch to your branch and run the "after" benchmarks:
   ```bash
   git switch my-branch && git stash pop
   go test ./benchmark/... -bench=BenchmarkXxx -benchmem -count=6 -cpu=1 | tee /tmp/after.txt
   ```

3. Compare with `benchstat`:
   ```bash
   benchstat /tmp/before.txt /tmp/after.txt
   ```

4. Paste the full `benchstat` output in the PR description.

### What to include in the PR description

- The optimization technique (pre-allocation, direct indexing, value receivers, etc.)
- The `benchstat` table showing time/op, allocs/op, and bytes/op deltas
- An explanation of **why** the change is faster, not just **what** changed

### When NOT to submit a performance PR

- If `benchstat` shows no statistically significant improvement (p >= 0.05)
- If the improvement is < 5% and adds code complexity
- If the change regresses other benchmarks — always run the full suite, not just the targeted benchmark

## Adding New Benchmarks

When adding a new helper function to the library, add a corresponding benchmark in the appropriate `{package}_{category}_bench_test.go` file. Use the standard parametric pattern:

```go
func BenchmarkMyFunc(b *testing.B) {
    for _, n := range lengths {
        data := genSliceInt(n)
        b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
            for i := 0; i < b.N; i++ {
                _ = lo.MyFunc(data, ...)
            }
        })
    }
}
```

Use shared generators from `helpers_test.go` — do not create local generator functions.


================================================
FILE: benchmark/core_condition_bench_test.go
================================================
package benchmark

import (
	"testing"

	"github.com/samber/lo"
)

func BenchmarkIf(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.If(i%2 == 0, "even").Else("odd")
	}
}

func BenchmarkIfElseIf(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.If(i%3 == 0, "fizz").
			ElseIf(i%3 == 1, "buzz").
			Else("none")
	}
}

func BenchmarkIfElseIfChain(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.If(i%5 == 0, "a").
			ElseIf(i%5 == 1, "b").
			ElseIf(i%5 == 2, "c").
			ElseIf(i%5 == 3, "d").
			Else("e")
	}
}

func BenchmarkSwitch(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.Switch[int, string](i%3).
			Case(0, "zero").
			Case(1, "one").
			Default("other")
	}
}

func BenchmarkSwitchChain(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.Switch[int, string](i%5).
			Case(0, "zero").
			Case(1, "one").
			Case(2, "two").
			Case(3, "three").
			Default("other")
	}
}


================================================
FILE: benchmark/core_find_bench_test.go
================================================
package benchmark

import (
	"strconv"
	"testing"

	"github.com/samber/lo"
)

func BenchmarkIndexOf(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[n-1] // worst case: last element
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.IndexOf(ints, target)
			}
		})
	}
}

func BenchmarkLastIndexOf(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[0]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.LastIndexOf(ints, target)
			}
		})
	}
}

func BenchmarkHasPrefix(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		prefix := ints[:n/10+1]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.HasPrefix(ints, prefix)
			}
		})
	}
}

func BenchmarkHasSuffix(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		suffix := ints[n-n/10-1:]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.HasSuffix(ints, suffix)
			}
		})
	}
}

func BenchmarkFind(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[n-1]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.Find(ints, func(v int) bool { return v == target })
			}
		})
	}
}

func BenchmarkFindIndexOf(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[n-1]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _, _ = lo.FindIndexOf(ints, func(v int) bool { return v == target })
			}
		})
	}
}

func BenchmarkFindLastIndexOf(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[0]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _, _ = lo.FindLastIndexOf(ints, func(v int) bool { return v == target })
			}
		})
	}
}

func BenchmarkFindOrElse(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FindOrElse(ints, -1, func(v int) bool { return v == -999 })
			}
		})
	}
}

func BenchmarkFindKey(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.FindKey(m, n/2)
			}
		})
	}
}

func BenchmarkFindKeyBy(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.FindKeyBy(m, func(_ string, v int) bool { return v == n/2 })
			}
		})
	}
}

func BenchmarkFindUniques(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FindUniques(ints)
			}
		})
	}
}

func BenchmarkFindUniquesBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FindUniquesBy(ints, func(v int) int { return v % 50 })
			}
		})
	}
}

func BenchmarkFindDuplicates(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FindDuplicates(ints)
			}
		})
	}
}

func BenchmarkFindDuplicatesBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FindDuplicatesBy(ints, func(v int) int { return v % 50 })
			}
		})
	}
}

func BenchmarkMin(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Min(ints)
			}
		})
	}
}

func BenchmarkMinIndex(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.MinIndex(ints)
			}
		})
	}
}

func BenchmarkMinBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MinBy(ints, func(a, b int) bool { return a < b })
			}
		})
	}
}

func BenchmarkMinIndexBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.MinIndexBy(ints, func(a, b int) bool { return a < b })
			}
		})
	}
}

func BenchmarkMax(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Max(ints)
			}
		})
	}
}

func BenchmarkMaxIndex(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.MaxIndex(ints)
			}
		})
	}
}

func BenchmarkMaxBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MaxBy(ints, func(a, b int) bool { return a > b })
			}
		})
	}
}

func BenchmarkMaxIndexBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.MaxIndexBy(ints, func(a, b int) bool { return a > b })
			}
		})
	}
}

func BenchmarkFirst(b *testing.B) {
	ints := genSliceInt(100)
	for i := 0; i < b.N; i++ {
		_, _ = lo.First(ints)
	}
}

func BenchmarkFirstOrEmpty(b *testing.B) {
	ints := genSliceInt(100)
	for i := 0; i < b.N; i++ {
		_ = lo.FirstOrEmpty(ints)
	}
}

func BenchmarkLast(b *testing.B) {
	ints := genSliceInt(100)
	for i := 0; i < b.N; i++ {
		_, _ = lo.Last(ints)
	}
}

func BenchmarkLastOrEmpty(b *testing.B) {
	ints := genSliceInt(100)
	for i := 0; i < b.N; i++ {
		_ = lo.LastOrEmpty(ints)
	}
}

func BenchmarkNth(b *testing.B) {
	ints := genSliceInt(100)
	for i := 0; i < b.N; i++ {
		_, _ = lo.Nth(ints, 50)
	}
}

func BenchmarkSample(b *testing.B) {
	ints := genSliceInt(100)
	for i := 0; i < b.N; i++ {
		_ = lo.Sample(ints)
	}
}

func BenchmarkSamples(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Samples(ints, n/4)
			}
		})
	}
}


================================================
FILE: benchmark/core_intersect_bench_test.go
================================================
package benchmark

import (
	"strconv"
	"testing"

	"github.com/samber/lo"
)

func BenchmarkContains(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[n-1]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Contains(ints, target)
			}
		})
	}
}

func BenchmarkContainsBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		target := ints[n-1]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ContainsBy(ints, func(v int) bool { return v == target })
			}
		})
	}
}

func BenchmarkEvery(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		subset := ints[:n/2]
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Every(ints, subset)
			}
		})
	}
}

func BenchmarkEveryBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.EveryBy(ints, func(v int) bool { return v >= 0 })
			}
		})
	}
}

func BenchmarkSome(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		subset := []int{ints[n-1]}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Some(ints, subset)
			}
		})
	}
}

func BenchmarkSomeBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.SomeBy(ints, func(v int) bool { return v < 0 })
			}
		})
	}
}

func BenchmarkNone(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		subset := []int{-1, -2, -3}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.None(ints, subset)
			}
		})
	}
}

func BenchmarkNoneBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.NoneBy(ints, func(v int) bool { return v < 0 })
			}
		})
	}
}

func BenchmarkIntersect(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		c := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Intersect(a, c)
			}
		})
	}
}

func BenchmarkIntersectBy(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		c := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.IntersectBy(func(v int) int { return v }, a, c)
			}
		})
	}
}

func BenchmarkUnion(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		c := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Union(a, c)
			}
		})
	}
}

func BenchmarkWithout(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Without(ints, 1, 2, 3, 4, 5)
			}
		})
	}
}

func BenchmarkWithoutBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.WithoutBy(ints, func(v int) int { return v % 100 }, 1, 2, 3, 4, 5)
			}
		})
	}
}

func BenchmarkWithoutEmpty(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		// sprinkle some zeroes
		for j := 0; j < n/10; j++ {
			ints[j*10] = 0
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.WithoutEmpty(ints) //nolint:staticcheck
			}
		})
	}
}

func BenchmarkWithoutNth(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.WithoutNth(ints, 0, n/2, n-1)
			}
		})
	}
}

func BenchmarkElementsMatch(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		c := make([]int, n)
		copy(c, a)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ElementsMatch(a, c)
			}
		})
	}
}


================================================
FILE: benchmark/core_map_bench_test.go
================================================
package benchmark

import (
	"strconv"
	"testing"

	"github.com/samber/lo"
	lop "github.com/samber/lo/parallel"
	"github.com/thoas/go-funk"
)

func BenchmarkKeys(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Keys(m)
			}
		})
	}
}

func BenchmarkUniqKeys(b *testing.B) {
	for _, n := range lengths {
		m1 := genMap(n)
		m2 := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.UniqKeys(m1, m2)
			}
		})
	}
}

func BenchmarkHasKey(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		key := strconv.Itoa(n / 2)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.HasKey(m, key)
			}
		})
	}
}

func BenchmarkValues(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Values(m)
			}
		})
	}
}

func BenchmarkUniqValues(b *testing.B) {
	m := []map[int64]int64{
		mapGenerator(1000),
		mapGenerator(1000),
		mapGenerator(1000),
	}
	b.Run("lo.UniqValues", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			_ = lo.UniqValues(m...)
		}
	})
}

func BenchmarkValueOr(b *testing.B) {
	m := genMap(100)
	b.Run("hit", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			_ = lo.ValueOr(m, "50", -1)
		}
	})
	b.Run("miss", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			_ = lo.ValueOr(m, "missing", -1)
		}
	})
}

func BenchmarkPickBy(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.PickBy(m, func(_ string, v int) bool { return v%2 == 0 })
			}
		})
	}
}

func BenchmarkPickByKeys(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		keys := make([]string, n/2)
		for i := range keys {
			keys[i] = strconv.Itoa(i * 2)
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.PickByKeys(m, keys)
			}
		})
	}
}

func BenchmarkPickByValues(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		vals := make([]int, n/2)
		for i := range vals {
			vals[i] = i * 2
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.PickByValues(m, vals)
			}
		})
	}
}

func BenchmarkOmitBy(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.OmitBy(m, func(_ string, v int) bool { return v%2 == 0 })
			}
		})
	}
}

func BenchmarkOmitByKeys(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		keys := make([]string, n/4)
		for i := range keys {
			keys[i] = strconv.Itoa(i)
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.OmitByKeys(m, keys)
			}
		})
	}
}

func BenchmarkOmitByValues(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		vals := make([]int, n/4)
		for i := range vals {
			vals[i] = i
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.OmitByValues(m, vals)
			}
		})
	}
}

func BenchmarkEntries(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Entries(m)
			}
		})
	}
}

func BenchmarkFromEntries(b *testing.B) {
	for _, n := range lengths {
		entries := make([]lo.Entry[string, int], n)
		for i := 0; i < n; i++ {
			entries[i] = lo.Entry[string, int]{Key: strconv.Itoa(i), Value: i}
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FromEntries(entries)
			}
		})
	}
}

func BenchmarkInvert(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Invert(m)
			}
		})
	}
}

func BenchmarkAssign(b *testing.B) {
	for _, n := range lengths {
		m1 := genMap(n)
		m2 := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Assign(m1, m2)
			}
		})
	}
}

func BenchmarkChunkEntries(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ChunkEntries(m, 5)
			}
		})
	}
}

func BenchmarkMapKeys(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MapKeys(m, func(_ int, k string) string { return k + "_x" })
			}
		})
	}
}

func BenchmarkMapValues(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MapValues(m, func(v int, _ string) int { return v * 2 })
			}
		})
	}
}

func BenchmarkMapEntries(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MapEntries(m, func(k string, v int) (string, int) { return k, v * 2 })
			}
		})
	}
}

func BenchmarkMapToSlice(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MapToSlice(m, func(k string, v int) string { return k + "=" + strconv.Itoa(v) })
			}
		})
	}
}

func BenchmarkFilterMapToSlice(b *testing.B) {
	for _, n := range lengths {
		m := genMap(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FilterMapToSlice(m, func(k string, v int) (string, bool) { return k, v%2 == 0 })
			}
		})
	}
}

func BenchmarkFilterKeys(b *testing.B) {
	m := mapGenerator(1000)
	b.Run("lo.FilterKeys", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			_ = lo.FilterKeys(m, func(k, v int64) bool { return k%2 == 0 })
		}
	})
}

func BenchmarkFilterValues(b *testing.B) {
	m := mapGenerator(1000)
	b.Run("lo.FilterValues", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			_ = lo.FilterValues(m, func(k, v int64) bool { return v%2 == 0 })
		}
	})
}

// ---------------------------------------------------------------------------
// Comparison benchmarks (lo vs lop vs go-funk vs manual loop)
// ---------------------------------------------------------------------------

func BenchmarkMapComparison(b *testing.B) {
	arr := sliceGenerator(1000000)

	b.Run("lo.Map", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			_ = lo.Map(arr, func(x int64, i int) string {
				return strconv.FormatInt(x, 10)
			})
		}
	})

	b.Run("lop.Map", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			_ = lop.Map(arr, func(x int64, i int) string {
				return strconv.FormatInt(x, 10)
			})
		}
	})

	b.Run("reflect", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			_ = funk.Map(arr, func(x int64) string {
				return strconv.FormatInt(x, 10)
			})
		}
	})

	b.Run("for", func(b *testing.B) {
		for n := 0; n < b.N; n++ {
			results := make([]string, len(arr))

			for i, item := range arr {
				result := strconv.FormatInt(item, 10)
				results[i] = result
			}
		}
	})
}


================================================
FILE: benchmark/core_math_bench_test.go
================================================
package benchmark

import (
	"strconv"
	"testing"

	"github.com/samber/lo"
)

func BenchmarkRange(b *testing.B) {
	for _, n := range lengths {
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Range(n)
			}
		})
	}
}

func BenchmarkRangeFrom(b *testing.B) {
	for _, n := range lengths {
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.RangeFrom(0, n)
			}
		})
	}
}

func BenchmarkRangeWithSteps(b *testing.B) {
	for _, n := range lengths {
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.RangeWithSteps(0, n, 1)
			}
		})
	}
}

func BenchmarkClamp(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.Clamp(15, 0, 10)
	}
}

func BenchmarkSum(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Sum(ints)
			}
		})
	}
}

func BenchmarkSumBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.SumBy(ints, func(v int) int { return v })
			}
		})
	}
}

func BenchmarkProduct(b *testing.B) {
	for _, n := range lengths {
		floats := make([]float64, n)
		for j := range floats {
			floats[j] = 1.0001
		}
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Product(floats)
			}
		})
	}
}

func BenchmarkProductBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ProductBy(ints, func(v int) float64 { return float64(v) * 0.001 })
			}
		})
	}
}

func BenchmarkMean(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Mean(ints)
			}
		})
	}
}

func BenchmarkMeanBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.MeanBy(ints, func(v int) int { return v })
			}
		})
	}
}

func BenchmarkMode(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Mode(ints)
			}
		})
	}
}


================================================
FILE: benchmark/core_slice_bench_test.go
================================================
package benchmark

import (
	"fmt"
	"sort"
	"strconv"
	"testing"

	"github.com/samber/lo"
)

func BenchmarkChunk(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Chunk(strs, 5)
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Chunk(ints, 5)
			}
		})
	}
}

func BenchmarkFlatten(b *testing.B) {
	for _, n := range lengths {
		ints := make([][]int, 0, n)
		for i := 0; i < n; i++ {
			ints = append(ints, genSliceInt(n))
		}
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Flatten(ints)
			}
		})
	}

	for _, n := range lengths {
		strs := make([][]string, 0, n)
		for i := 0; i < n; i++ {
			strs = append(strs, genSliceString(n))
		}
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Flatten(strs)
			}
		})
	}
}

func BenchmarkDrop(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Drop(strs, n/4)
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Drop(ints, n/4)
			}
		})
	}
}

func BenchmarkDropRight(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.DropRight(strs, n/4)
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.DropRight(ints, n/4)
			}
		})
	}
}

func BenchmarkDropWhile(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.DropWhile(strs, func(v string) bool { return len(v) < 4 })
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.DropWhile(ints, func(v int) bool { return i < 10_000 })
			}
		})
	}
}

func BenchmarkDropRightWhile(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.DropRightWhile(strs, func(v string) bool { return len(v) < 4 })
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.DropRightWhile(ints, func(v int) bool { return i < 10_000 })
			}
		})
	}
}

func BenchmarkDropByIndex(b *testing.B) {
	for _, n := range lengths {
		for _, indexes := range [][]int{
			{0},
			{0, n / 2, n / 4, n - 1},
			lo.Range(n),
		} {
			name := fmt.Sprintf("size_%d/indexes_%d/", n, len(indexes))

			strs := genSliceString(n)
			b.Run(name+"strings", func(b *testing.B) {
				for i := 0; i < b.N; i++ {
					_ = lo.DropByIndex(strs, indexes...)
				}
			})

			ints := genSliceInt(n)
			b.Run(name+"ints", func(b *testing.B) {
				for i := 0; i < b.N; i++ {
					_ = lo.DropByIndex(ints, indexes...)
				}
			})

			heavy := genSliceHeavy(n)
			b.Run(name+"heavy", func(b *testing.B) {
				for i := 0; i < b.N; i++ {
					_ = lo.DropByIndex(heavy, indexes...)
				}
			})
		}
	}
}

func BenchmarkReplace(b *testing.B) {
	lengths := []int{1_000, 10_000, 100_000}
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Replace(strs, strs[n/4], "123123", 10)
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Replace(ints, ints[n/4], 123123, 10)
			}
		})
	}
}

func BenchmarkReject(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Reject(strs, func(v string, _ int) bool { return len(v) < 3 })
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Reject(ints, func(v, _ int) bool { return v < 50000 })
			}
		})
	}
}

func BenchmarkRejectErr(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.RejectErr(strs, func(v string, _ int) (bool, error) { return len(v) < 3, nil })
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.RejectErr(ints, func(v, _ int) (bool, error) { return v < 50000, nil })
			}
		})
	}
}

func BenchmarkRejectMap(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.RejectMap(strs, func(v string, _ int) (string, bool) { return v, len(v) < 3 })
			}
		})
	}

	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.RejectMap(ints, func(v, _ int) (int, bool) { return v, v < 50000 })
			}
		})
	}
}

func BenchmarkUniqMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.UniqMap(ints, func(v, _ int) int { return v % 50 })
			}
		})
	}

	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.UniqMap(strs, func(v string, _ int) string { return v })
			}
		})
	}
}

func BenchmarkRepeatBy(b *testing.B) {
	for _, n := range lengths {
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.RepeatBy(n, func(index int) int { return index * 2 })
			}
		})
	}

	for _, n := range lengths {
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.RepeatBy(n, strconv.Itoa)
			}
		})
	}
}

func BenchmarkFill(b *testing.B) {
	for _, n := range lengths {
		collection := make([]clonableString, n)
		for i := range collection {
			collection[i] = clonableString{strconv.Itoa(i)}
		}
		b.Run(fmt.Sprintf("size_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Fill(collection, clonableString{"hello"})
			}
		})
	}
}

func BenchmarkRepeat(b *testing.B) {
	for _, n := range lengths {
		b.Run(fmt.Sprintf("size_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Repeat(n, clonableString{"hello"})
			}
		})
	}
}

func BenchmarkFilter(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Filter(ints, func(v, _ int) bool { return v%2 == 0 })
			}
		})
	}
}

func BenchmarkFilterErr(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.FilterErr(ints, func(v, _ int) (bool, error) { return v%2 == 0, nil })
			}
		})
	}
}

func BenchmarkSliceMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Map(ints, func(v, _ int) int { return v * 2 })
			}
		})
	}
}

func BenchmarkMapErr(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.MapErr(ints, func(v, _ int) (int, error) { return v * 2, nil })
			}
		})
	}
}

func BenchmarkFilterMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FilterMap(ints, func(v, _ int) (int, bool) { return v * 2, v%2 == 0 })
			}
		})
	}
}

func BenchmarkFlatMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FlatMap(ints, func(v, _ int) []int { return []int{v, v + 1} })
			}
		})
	}
}

func BenchmarkReduce(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Reduce(ints, func(agg, item, _ int) int { return agg + item }, 0)
			}
		})
	}
}

func BenchmarkReduceRight(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ReduceRight(ints, func(agg, item, _ int) int { return agg + item }, 0)
			}
		})
	}
}

func BenchmarkForEach(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				lo.ForEach(ints, func(_, _ int) {})
			}
		})
	}
}

func BenchmarkForEachWhile(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				lo.ForEachWhile(ints, func(_, _ int) bool { return true })
			}
		})
	}
}

func BenchmarkTimes(b *testing.B) {
	for _, n := range lengths {
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Times(n, func(i int) int { return i })
			}
		})
	}
}

func BenchmarkUniq(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Uniq(ints)
			}
		})
	}
}

func BenchmarkUniqBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.UniqBy(ints, func(v int) int { return v % 100 })
			}
		})
	}
}

func BenchmarkGroupBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.GroupBy(ints, func(v int) int { return v % 10 })
			}
		})
	}
}

func BenchmarkGroupByMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.GroupByMap(ints, func(v int) (int, string) { return v % 10, strconv.Itoa(v) })
			}
		})
	}
}

func BenchmarkPartitionBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.PartitionBy(ints, func(v int) int { return v % 5 })
			}
		})
	}
}

func BenchmarkConcat(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		c := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Concat(a, c)
			}
		})
	}
}

func BenchmarkWindow(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Window(ints, 5)
			}
		})
	}
}

func BenchmarkSliding(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Sliding(ints, 5, 2)
			}
		})
	}
}

func BenchmarkInterleave(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		c := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Interleave(a, c)
			}
		})
	}
}

func BenchmarkShuffle(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Shuffle(ints) //nolint:staticcheck
			}
		})
	}
}

func BenchmarkReverse(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Reverse(ints) //nolint:staticcheck
			}
		})
	}
}

func BenchmarkRepeatByErr(b *testing.B) {
	for _, n := range lengths {
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.RepeatByErr(n, func(index int) (int, error) { return index * 2, nil })
			}
		})
	}
}

func BenchmarkKeyBy(b *testing.B) {
	for _, n := range lengths {
		strs := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.KeyBy(strs, func(v string) string { return v })
			}
		})
	}
}

func BenchmarkAssociate(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Associate(ints, func(v int) (int, string) { return v, strconv.Itoa(v) })
			}
		})
	}
}

func BenchmarkSliceToMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.SliceToMap(ints, func(v int) (int, string) { return v, strconv.Itoa(v) })
			}
		})
	}
}

func BenchmarkFilterSliceToMap(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FilterSliceToMap(ints, func(v int) (int, string, bool) { return v, strconv.Itoa(v), v%2 == 0 })
			}
		})
	}
}

func BenchmarkKeyify(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Keyify(ints)
			}
		})
	}
}

func BenchmarkTake(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Take(ints, n/4)
			}
		})
	}
}

func BenchmarkTakeWhile(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.TakeWhile(ints, func(v int) bool { return v < 50000 })
			}
		})
	}
}

func BenchmarkTakeFilter(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.TakeFilter(ints, 5, func(v, _ int) bool { return v%2 == 0 })
			}
		})
	}
}

func BenchmarkFilterReject(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.FilterReject(ints, func(v, _ int) bool { return v%2 == 0 })
			}
		})
	}
}

func BenchmarkCount(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Count(ints, 42)
			}
		})
	}
}

func BenchmarkCountBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.CountBy(ints, func(v int) bool { return v%2 == 0 })
			}
		})
	}
}

func BenchmarkCountValues(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.CountValues(ints)
			}
		})
	}
}

func BenchmarkCountValuesBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.CountValuesBy(ints, func(v int) int { return v % 100 })
			}
		})
	}
}

func BenchmarkSubset(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Subset(ints, n/4, uint(n/2))
			}
		})
	}
}

func BenchmarkSlice(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Slice(ints, n/4, n*3/4)
			}
		})
	}
}

func BenchmarkReplaceAll(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ReplaceAll(ints, ints[n/4], 123123)
			}
		})
	}
}

func BenchmarkClone(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Clone(ints)
			}
		})
	}
}

func BenchmarkCompact(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Compact(ints)
			}
		})
	}
}

func BenchmarkIsSorted(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.IsSorted(ints)
			}
		})
	}
}

func BenchmarkIsSortedBy(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.IsSortedBy(ints, func(v int) int { return v })
			}
		})
	}
}

func BenchmarkIsSortedBySorted(b *testing.B) {
	for _, n := range lengths {
		data := genSliceInt(n)
		sort.Ints(data)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				lo.IsSortedBy(data, func(v int) int { return v })
			}
		})
	}
}

func BenchmarkSplice(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		extra := []int{1, 2, 3}
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Splice(ints, n/2, extra...)
			}
		})
	}
}

func BenchmarkCut(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		sep := ints[n/4 : n/4+3]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _, _ = lo.Cut(ints, sep)
			}
		})
	}
}

func BenchmarkCutPrefix(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		prefix := ints[:3]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.CutPrefix(ints, prefix)
			}
		})
	}
}

func BenchmarkCutSuffix(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		suffix := ints[n-3:]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.CutSuffix(ints, suffix)
			}
		})
	}
}

func BenchmarkTrim(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		cutset := ints[:3]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.Trim(ints, cutset)
			}
		})
	}
}

func BenchmarkTrimLeft(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		cutset := ints[:3]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.TrimLeft(ints, cutset)
			}
		})
	}
}

func BenchmarkTrimRight(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		cutset := ints[n-3:]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.TrimRight(ints, cutset)
			}
		})
	}
}

func BenchmarkTrimPrefix(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		prefix := ints[:3]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.TrimPrefix(ints, prefix)
			}
		})
	}
}

func BenchmarkTrimSuffix(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		suffix := ints[n-3:]
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.TrimSuffix(ints, suffix)
			}
		})
	}
}

func BenchmarkFilterTakeVsFilterAndTake(b *testing.B) {
	n := 1000
	ints := genSliceInt(n)

	b.Run("lo.TakeFilter", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			_ = lo.TakeFilter(ints, 5, func(v, _ int) bool {
				return v%2 == 0
			})
		}
	})

	b.Run("lo.Filter+lo.Take", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			_ = lo.Take(lo.Filter(ints, func(v, _ int) bool { return v%2 == 0 }), 5)
		}
	})

	b.Run("lo.Filter+native_slice", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			filtered := lo.Filter(ints, func(v, _ int) bool { return v%2 == 0 })
			takeN := 5
			if takeN > len(filtered) {
				_ = filtered
			} else {
				_ = filtered[:takeN]
			}
		}
	})

	b.Run("manual_loop", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			result := make([]int, 0, 5)
			count := 0
			for _, v := range ints {
				if v%2 == 0 {
					result = append(result, v)
					count++
					if count >= 5 {
						break
					}
				}
			}
			_ = result
		}
	})
}

func BenchmarkDifference(b *testing.B) {
	for _, n := range lengths {
		ints1 := genSliceInt(n)
		ints2 := genSliceInt(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.Difference(ints1, ints2)
			}
		})
	}

	for _, n := range lengths {
		strs1 := genSliceString(n)
		strs2 := genSliceString(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.Difference(strs1, strs2)
			}
		})
	}
}

func BenchmarkFromSlicePtr(b *testing.B) {
	for _, n := range lengths {
		ptrs := lo.ToSlicePtr(genSliceInt(n))
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FromSlicePtr(ptrs)
			}
		})
	}

	for _, n := range lengths {
		ptrs := lo.ToSlicePtr(genSliceString(n))
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FromSlicePtr(ptrs)
			}
		})
	}
}

func BenchmarkFromSlicePtrOr(b *testing.B) {
	for _, n := range lengths {
		ptrs := lo.ToSlicePtr(genSliceInt(n))
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FromSlicePtrOr(ptrs, -1)
			}
		})
	}

	for _, n := range lengths {
		ptrs := lo.ToSlicePtr(genSliceString(n))
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.FromSlicePtrOr(ptrs, "default")
			}
		})
	}
}


================================================
FILE: benchmark/core_string_bench_test.go
================================================
package benchmark

import (
	"testing"

	"github.com/samber/lo"
)

func BenchmarkRandomString(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.RandomString(64, lo.AlphanumericCharset)
	}
}

func BenchmarkSubstring(b *testing.B) {
	s := lo.RandomString(1000, lo.LettersCharset)
	for i := 0; i < b.N; i++ {
		_ = lo.Substring(s, 100, 200)
	}
}

func BenchmarkChunkString(b *testing.B) {
	s := lo.RandomString(1000, lo.LettersCharset)
	for i := 0; i < b.N; i++ {
		_ = lo.ChunkString(s, 10)
	}
}

func BenchmarkRuneLength(b *testing.B) {
	s := lo.RandomString(1000, lo.LettersCharset)
	for i := 0; i < b.N; i++ {
		_ = lo.RuneLength(s)
	}
}

func BenchmarkPascalCase(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.PascalCase("some_long_variable_name")
	}
}

func BenchmarkCamelCase(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.CamelCase("some_long_variable_name")
	}
}

func BenchmarkKebabCase(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.KebabCase("someLongVariableName")
	}
}

func BenchmarkSnakeCase(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.SnakeCase("someLongVariableName")
	}
}

func BenchmarkWords(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.Words("someLongVariableName")
	}
}

func BenchmarkCapitalize(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.Capitalize("hello world")
	}
}

func BenchmarkEllipsis(b *testing.B) {
	s := lo.RandomString(200, lo.LettersCharset)
	for i := 0; i < b.N; i++ {
		_ = lo.Ellipsis(s, 50)
	}
}


================================================
FILE: benchmark/core_tuples_bench_test.go
================================================
package benchmark

import (
	"fmt"
	"testing"

	"github.com/samber/lo"
)

func BenchmarkZip2_Equal(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		s := genSliceString(n)
		b.Run(fmt.Sprintf("n_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				lo.Zip2(a, s)
			}
		})
	}
}

func BenchmarkZip2_Unequal(b *testing.B) {
	for _, n := range lengths {
		a := genSliceInt(n)
		s := genSliceString(n / 2)
		b.Run(fmt.Sprintf("n_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				lo.Zip2(a, s)
			}
		})
	}
}

func BenchmarkUnzip2(b *testing.B) {
	for _, n := range lengths {
		tuples := make([]lo.Tuple2[int, string], n)
		for i := range tuples {
			tuples[i] = lo.Tuple2[int, string]{A: i, B: "x"}
		}
		b.Run(fmt.Sprintf("n_%d", n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				lo.Unzip2(tuples)
			}
		})
	}
}


================================================
FILE: benchmark/core_type_manipulation_bench_test.go
================================================
package benchmark

import (
	"strconv"
	"testing"

	"github.com/samber/lo"
)

func BenchmarkToPtr(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.ToPtr(42)
	}
}

func BenchmarkFromPtr(b *testing.B) {
	p := lo.ToPtr(42)
	for i := 0; i < b.N; i++ {
		_ = lo.FromPtr(p)
	}
}

func BenchmarkFromPtrOr(b *testing.B) {
	var p *int
	for i := 0; i < b.N; i++ {
		_ = lo.FromPtrOr(p, 99)
	}
}

func BenchmarkToSlicePtr(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ToSlicePtr(ints)
			}
		})
	}
}

func BenchmarkToAnySlice(b *testing.B) {
	for _, n := range lengths {
		ints := genSliceInt(n)
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_ = lo.ToAnySlice(ints)
			}
		})
	}
}

func BenchmarkFromAnySlice(b *testing.B) {
	for _, n := range lengths {
		anys := lo.ToAnySlice(genSliceInt(n))
		b.Run(strconv.Itoa(n), func(b *testing.B) {
			for i := 0; i < b.N; i++ {
				_, _ = lo.FromAnySlice[int](anys)
			}
		})
	}
}

func BenchmarkIsEmpty(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.IsEmpty(0)
	}
}

func BenchmarkIsNotEmpty(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = lo.IsNotEmpty(42)
	}
}

func BenchmarkCoalesce(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_, _ = lo.Coalesce(0, 0, 0, 42, 99)
	}
}


================================================
FILE: benchmark/helpers_test.go
================================================
package benchmark

import (
	"math/rand"
	"strconv"
	"time"
)

var lengths = []int{10, 100, 1000}

func genSliceString(n int) []string {
	res := make([]string, 0, n)
	for i := 0; i < n; i++ {
		res = append(res, strconv.Itoa(rand.Intn(100_000)))
	}
	return res
}

func genSliceInt(n int) []int {
	res := make([]int, 0, n)
	for i := 0; i < n; i++ {
		res = append(res, rand.Intn(100_000))
	}
	return res
}

type heavy = [100]int

func genSliceHeavy(n int) []heavy {
	result := make([]heavy, n)
	for i := range result {
		for j := range result[i] {
			result[i][j] = i + j
		}
	}
	return result
}

func genMap(n int) map[string]int {
	m := make(map[string]int, n)
	for i := 0; i < n; i++ {
		m[strconv.Itoa(i)] = i
	}
	return m
}

type clonableString struct {
	val string
}

func (c clonableString) Clone() clonableString {
	return clonableString{c.val}
}

// sliceGenerator creates a random int64 slice (used by comparison benchmarks).
func sliceGenerator(size uint) []int64 {
	r := rand.New(rand.NewSource(time.Now().Unix()))

	result := make([]int64, size)

	for i := uint(0); i < size; i++ {
		result[i] = r.Int63()
	}

	return result
}

// mapGenerator creates a random int64 map (used by comparison benchmarks).
func mapGenerator(size uint) map[int64]int64 {
	r := rand.New(rand.NewSource(time.Now().Unix()))

	result := make(map[int64]int64, size)

	for i := uint(0); i < size; i++ {
		result[int64(i)] = r.Int63()
	}

	return result
}


================================================
FILE: benchmark/it_find_bench_test.go
================================================
//go:build go1.23

package benchmark

import (
	"fmt"
	"math/rand/v2"
	"testing"

	"github.com/samber/lo/it"
)

func BenchmarkItFind(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_, _ = it.Find(ints, func(x int) bool { return x == 0 })
			}
		})
	}
}

func BenchmarkItContains(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Contains(ints, 42)
			}
		})
	}
}

func BenchmarkItContainsBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			target := rand.IntN(100_000)
			for range b.N {
				_ = it.ContainsBy(ints, func(x int) bool { return x == target })
			}
		})
	}
}

func BenchmarkItEvery(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Every(ints, 1, 2, 3)
			}
		})
	}
}

func BenchmarkItEveryBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.EveryBy(ints, func(x int) bool { return x >= 0 })
			}
		})
	}
}

func BenchmarkItSome(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Some(ints, 1, 2, 3)
			}
		})
	}
}

func BenchmarkItSomeBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			target := rand.IntN(100_000)
			for range b.N {
				_ = it.SomeBy(ints, func(x int) bool { return x == target })
			}
		})
	}
}

func BenchmarkItNone(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.None(ints, -1, -2, -3)
			}
		})
	}
}

func BenchmarkItNoneBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			target := rand.IntN(100_000)
			for range b.N {
				_ = it.NoneBy(ints, func(x int) bool { return x == target })
			}
		})
	}
}

func BenchmarkItIntersect(b *testing.B) {
	for _, n := range itLengths {
		a := genInts(n)
		c := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Intersect(a, c) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItUnion(b *testing.B) {
	for _, n := range itLengths {
		a := genInts(n)
		c := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Union(a, c) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItWithout(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Without(ints, 1, 2, 3, 4, 5) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItWithoutNth(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.WithoutNth(ints, 0, n/2, n-1) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItIndexOf(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.IndexOf(ints, -1)
			}
		})
	}
}

func BenchmarkItLastIndexOf(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.LastIndexOf(ints, -1)
			}
		})
	}
}

func BenchmarkItHasPrefix(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.HasPrefix(ints, -1, -2, -3)
			}
		})
	}
}

func BenchmarkItHasSuffix(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.HasSuffix(ints, -1, -2, -3)
			}
		})
	}
}

func BenchmarkItFindIndexOf(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_, _, _ = it.FindIndexOf(ints, func(x int) bool { return x == -1 })
			}
		})
	}
}

func BenchmarkItFindOrElse(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.FindOrElse(ints, -1, func(x int) bool { return x == -1 })
			}
		})
	}
}

func BenchmarkItFindUniques(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.FindUniques(ints) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItFindDuplicates(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.FindDuplicates(ints) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItMin(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Min(ints)
			}
		})
	}
}

func BenchmarkItMax(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Max(ints)
			}
		})
	}
}

func BenchmarkItMinBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.MinBy(ints, func(a, b int) bool { return a < b })
			}
		})
	}
}

func BenchmarkItMaxBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.MaxBy(ints, func(a, b int) bool { return a > b })
			}
		})
	}
}

func BenchmarkItFirst(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_, _ = it.First(ints)
			}
		})
	}
}

func BenchmarkItLast(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_, _ = it.Last(ints)
			}
		})
	}
}

func BenchmarkItNth(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_, _ = it.Nth(ints, n/2)
			}
		})
	}
}

func BenchmarkItSample(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Sample(ints)
			}
		})
	}
}

func BenchmarkItSamples(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Samples(ints, 5) { //nolint:revive
				}
			}
		})
	}
}


================================================
FILE: benchmark/it_helpers_test.go
================================================
//go:build go1.23

package benchmark

import (
	"iter"
	"math/rand/v2"
	"strconv"
)

var itLengths = []int{10, 100, 1000}

func genStrings(n int) iter.Seq[string] {
	return func(yield func(string) bool) {
		for range n {
			if !yield(strconv.Itoa(rand.IntN(100_000))) {
				break
			}
		}
	}
}

func genInts(n int) iter.Seq[int] {
	return func(yield func(int) bool) {
		for range n {
			if !yield(rand.IntN(100_000)) {
				break
			}
		}
	}
}

func genIntPtrSeq(n int) iter.Seq[*int] {
	return func(yield func(*int) bool) {
		for range n {
			v := rand.IntN(100_000)
			if !yield(&v) {
				break
			}
		}
	}
}

func genMapStringInt(n int) map[string]int {
	m := make(map[string]int, n)
	for i := range n {
		m[strconv.Itoa(i)] = rand.IntN(100_000)
	}
	return m
}

func genMapSeq(n int) iter.Seq[map[string]int] {
	return func(yield func(map[string]int) bool) {
		for range n {
			m := map[string]int{strconv.Itoa(rand.IntN(100_000)): rand.IntN(100_000)}
			if !yield(m) {
				break
			}
		}
	}
}


================================================
FILE: benchmark/it_map_bench_test.go
================================================
//go:build go1.23

package benchmark

import (
	"fmt"
	"strings"
	"testing"

	"github.com/samber/lo/it"
)

func BenchmarkItKeys(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Keys(m) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItUniqKeys(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.UniqKeys(m) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItValues(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Values(m) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItUniqValues(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.UniqValues(m) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItEntries(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Entries(m) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItFromEntries(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		entries := it.Entries(m)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.FromEntries(entries)
			}
		})
	}
}

func BenchmarkItInvert(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		entries := it.Entries(m)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Invert(entries) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItAssign(b *testing.B) {
	for _, n := range itLengths {
		seq := genMapSeq(n)
		b.Run(fmt.Sprintf("maps_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Assign(seq)
			}
		})
	}
}

func BenchmarkItFilterKeys(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.FilterKeys(m, func(_ string, v int) bool { return v%2 == 0 }) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItFilterValues(b *testing.B) {
	for _, n := range itLengths {
		m := genMapStringInt(n)
		b.Run(fmt.Sprintf("map_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.FilterValues(m, func(_ string, v int) bool { return v%2 == 0 }) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItChunkString(b *testing.B) {
	for _, n := range itLengths {
		var sb strings.Builder
		for range n {
			sb.WriteString("a")
		}
		s := sb.String()
		b.Run(fmt.Sprintf("len_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.ChunkString(s, 5) { //nolint:revive
				}
			}
		})
	}
}


================================================
FILE: benchmark/it_math_bench_test.go
================================================
//go:build go1.23

package benchmark

import (
	"fmt"
	"testing"

	"github.com/samber/lo/it"
)

func BenchmarkItSum(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Sum(ints)
			}
		})
	}
}

func BenchmarkItSumBy(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.SumBy(ints, func(x int) int { return x })
			}
		})
	}
}

func BenchmarkItProduct(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Product(ints)
			}
		})
	}
}

func BenchmarkItMean(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Mean(ints)
			}
		})
	}
}

func BenchmarkItMode(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Mode(ints)
			}
		})
	}
}

func BenchmarkItRange(b *testing.B) {
	for _, n := range itLengths {
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Range(n) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItLength(b *testing.B) {
	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				_ = it.Length(ints)
			}
		})
	}
}


================================================
FILE: benchmark/it_slice_bench_test.go
================================================
//go:build go1.23

package benchmark

import (
	"fmt"
	"iter"
	"testing"

	"github.com/samber/lo/it"
)

func BenchmarkItChunk(b *testing.B) {
	for _, n := range itLengths {
		strs := genStrings(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Chunk(strs, 5) { //nolint:revive
				}
			}
		})
	}

	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Chunk(ints, 5) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItFlatten(b *testing.B) {
	for _, n := range itLengths {
		ints := make([]iter.Seq[int], 0, n)
		for range n {
			ints = append(ints, genInts(n))
		}
		b.Run(fmt.Sprintf("ints_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Flatten(ints) { //nolint:revive
				}
			}
		})
	}

	for _, n := range itLengths {
		strs := make([]iter.Seq[string], 0, n)
		for range n {
			strs = append(strs, genStrings(n))
		}
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Flatten(strs) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItDrop(b *testing.B) {
	for _, n := range itLengths {
		strs := genStrings(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Drop(strs, n/4) { //nolint:revive
				}
			}
		})
	}

	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for range b.N {
				for range it.Drop(ints, n/4) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItDropWhile(b *testing.B) {
	for _, n := range itLengths {
		strs := genStrings(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.DropWhile(strs, func(v string) bool { return len(v) < 4 }) { //nolint:revive
				}
			}
		})
	}

	for _, n := range itLengths {
		ints := genInts(n)
		b.Run(fmt.Sprintf("ints%d", n), func(b *testing.B) {
			for i := range b.N {
				for range it.DropWhile(ints, func(v int) bool { return i < 10_000 }) { //nolint:revive
				}
			}
		})
	}
}

func BenchmarkItDropLastWhile(b *testing.B) {
	for _, n := range itLengths {
		strs := genStrings(n)
		b.Run(fmt.Sprintf("strings_%d", n), func(b *testing.B) {
			for range b.N {
				for range it.DropLastWhile(strs, func(v string) bool { return len(v) < 4 }) { //nolint:revive
				}
			}
		})
	}

	for _, n := range itLengths {
		ints := genInts(n)
Download .txt
gitextract_vboab2u1/

├── .github/
│   ├── FUNDING.yml
│   ├── PULL_REQUEST_TEMPLATE/
│   │   ├── config.yml
│   │   ├── new_helper.md
│   │   └── other.md
│   ├── dependabot.yml
│   └── workflows/
│       ├── doc.yml
│       ├── lint.yml
│       ├── release.yml
│       ├── test.simd.yml
│       └── test.yml
├── .gitignore
├── .golangci.yml
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── benchmark/
│   ├── CLAUDE.md
│   ├── core_condition_bench_test.go
│   ├── core_find_bench_test.go
│   ├── core_intersect_bench_test.go
│   ├── core_map_bench_test.go
│   ├── core_math_bench_test.go
│   ├── core_slice_bench_test.go
│   ├── core_string_bench_test.go
│   ├── core_tuples_bench_test.go
│   ├── core_type_manipulation_bench_test.go
│   ├── helpers_test.go
│   ├── it_find_bench_test.go
│   ├── it_helpers_test.go
│   ├── it_map_bench_test.go
│   ├── it_math_bench_test.go
│   ├── it_slice_bench_test.go
│   ├── it_type_manipulation_bench_test.go
│   ├── mutable_slice_bench_test.go
│   └── parallel_slice_bench_test.go
├── channel.go
├── channel_test.go
├── concurrency.go
├── concurrency_test.go
├── condition.go
├── condition_test.go
├── constraints.go
├── docs/
│   ├── .gitignore
│   ├── CLAUDE.md
│   ├── README.md
│   ├── data/
│   │   ├── core-assert.md
│   │   ├── core-assign.md
│   │   ├── core-associate.md
│   │   ├── core-asyncx.md
│   │   ├── core-attempt.md
│   │   ├── core-attemptwhile.md
│   │   ├── core-attemptwhilewithdelay.md
│   │   ├── core-attemptwithdelay.md
│   │   ├── core-buffer.md
│   │   ├── core-bufferwithtimeout.md
│   │   ├── core-camelcase.md
│   │   ├── core-capitalize.md
│   │   ├── core-channeldispatcher.md
│   │   ├── core-channeltoslice.md
│   │   ├── core-chunk.md
│   │   ├── core-chunkentries.md
│   │   ├── core-chunkstring.md
│   │   ├── core-clamp.md
│   │   ├── core-clone.md
│   │   ├── core-coalesce.md
│   │   ├── core-coalescemap.md
│   │   ├── core-coalescemaporempty.md
│   │   ├── core-coalesceorempty.md
│   │   ├── core-coalesceslice.md
│   │   ├── core-coalescesliceorempty.md
│   │   ├── core-compact.md
│   │   ├── core-concat.md
│   │   ├── core-contains.md
│   │   ├── core-containsby.md
│   │   ├── core-count.md
│   │   ├── core-countby.md
│   │   ├── core-countbyerr.md
│   │   ├── core-countvalues.md
│   │   ├── core-countvaluesby.md
│   │   ├── core-crossjoinbyerrx.md
│   │   ├── core-crossjoinbyx.md
│   │   ├── core-crossjoinx.md
│   │   ├── core-cut.md
│   │   ├── core-cutprefix.md
│   │   ├── core-cutsuffix.md
│   │   ├── core-difference.md
│   │   ├── core-dispatchingstrategy.md
│   │   ├── core-drop.md
│   │   ├── core-dropbyindex.md
│   │   ├── core-dropright.md
│   │   ├── core-droprightwhile.md
│   │   ├── core-dropwhile.md
│   │   ├── core-durationx.md
│   │   ├── core-earliest.md
│   │   ├── core-earliestby.md
│   │   ├── core-earliestbyerr.md
│   │   ├── core-elementsmatch.md
│   │   ├── core-elementsmatchby.md
│   │   ├── core-ellipsis.md
│   │   ├── core-empty.md
│   │   ├── core-emptyabletoptr.md
│   │   ├── core-entries.md
│   │   ├── core-errorsas.md
│   │   ├── core-every.md
│   │   ├── core-everyby.md
│   │   ├── core-fanin.md
│   │   ├── core-fanout.md
│   │   ├── core-fill.md
│   │   ├── core-filter.md
│   │   ├── core-filtererr.md
│   │   ├── core-filterkeys.md
│   │   ├── core-filterkeyserr.md
│   │   ├── core-filtermap.md
│   │   ├── core-filtermaptoslice.md
│   │   ├── core-filtermaptosliceerr.md
│   │   ├── core-filterreject.md
│   │   ├── core-filterslicetomap.md
│   │   ├── core-filtervalues.md
│   │   ├── core-filtervalueserr.md
│   │   ├── core-find.md
│   │   ├── core-findduplicates.md
│   │   ├── core-findduplicatesby.md
│   │   ├── core-findduplicatesbyerr.md
│   │   ├── core-finderr.md
│   │   ├── core-findindexof.md
│   │   ├── core-findkey.md
│   │   ├── core-findkeyby.md
│   │   ├── core-findlastindexof.md
│   │   ├── core-findorelse.md
│   │   ├── core-finduniques.md
│   │   ├── core-finduniquesby.md
│   │   ├── core-first.md
│   │   ├── core-firstor.md
│   │   ├── core-firstorempty.md
│   │   ├── core-flatmap.md
│   │   ├── core-flatmaperr.md
│   │   ├── core-flatten.md
│   │   ├── core-foreach.md
│   │   ├── core-foreachwhile.md
│   │   ├── core-fromanyslice.md
│   │   ├── core-fromentries.md
│   │   ├── core-frompairs.md
│   │   ├── core-fromptr.md
│   │   ├── core-fromptror.md
│   │   ├── core-fromsliceptr.md
│   │   ├── core-generator.md
│   │   ├── core-groupby.md
│   │   ├── core-groupbyerr.md
│   │   ├── core-groupbymap.md
│   │   ├── core-groupbymaperr.md
│   │   ├── core-haskey.md
│   │   ├── core-hasprefix.md
│   │   ├── core-hassuffix.md
│   │   ├── core-if.md
│   │   ├── core-indexof.md
│   │   ├── core-interleave.md
│   │   ├── core-intersect.md
│   │   ├── core-intersectby.md
│   │   ├── core-invert.md
│   │   ├── core-isempty.md
│   │   ├── core-isnil.md
│   │   ├── core-isnotempty.md
│   │   ├── core-isnotnil.md
│   │   ├── core-issorted.md
│   │   ├── core-issortedby.md
│   │   ├── core-kebabcase.md
│   │   ├── core-keyby.md
│   │   ├── core-keybyerr.md
│   │   ├── core-keyify.md
│   │   ├── core-keys.md
│   │   ├── core-last.md
│   │   ├── core-lastindexof.md
│   │   ├── core-lastor.md
│   │   ├── core-lastorempty.md
│   │   ├── core-latest.md
│   │   ├── core-latestby.md
│   │   ├── core-latestbyerr.md
│   │   ├── core-map.md
│   │   ├── core-mapentries.md
│   │   ├── core-mapentrieserr.md
│   │   ├── core-maperr.md
│   │   ├── core-mapkeys.md
│   │   ├── core-mapkeyserr.md
│   │   ├── core-maptoslice.md
│   │   ├── core-maptosliceerr.md
│   │   ├── core-mapvalues.md
│   │   ├── core-mapvalueserr.md
│   │   ├── core-max.md
│   │   ├── core-maxby.md
│   │   ├── core-maxbyerr.md
│   │   ├── core-maxindex.md
│   │   ├── core-maxindexby.md
│   │   ├── core-maxindexbyerr.md
│   │   ├── core-mean.md
│   │   ├── core-meanby.md
│   │   ├── core-meanbyerr.md
│   │   ├── core-min.md
│   │   ├── core-minby.md
│   │   ├── core-minbyerr.md
│   │   ├── core-minindex.md
│   │   ├── core-minindexby.md
│   │   ├── core-minindexbyerr.md
│   │   ├── core-mode.md
│   │   ├── core-mustx.md
│   │   ├── core-newdebounce.md
│   │   ├── core-newdebounceby.md
│   │   ├── core-newthrottle.md
│   │   ├── core-newthrottleby.md
│   │   ├── core-newthrottlebywithcount.md
│   │   ├── core-newthrottlewithcount.md
│   │   ├── core-newtransaction.md
│   │   ├── core-nil.md
│   │   ├── core-none.md
│   │   ├── core-noneby.md
│   │   ├── core-nth.md
│   │   ├── core-nthor.md
│   │   ├── core-nthorempty.md
│   │   ├── core-omitby.md
│   │   ├── core-omitbyerr.md
│   │   ├── core-omitbykeys.md
│   │   ├── core-omitbyvalues.md
│   │   ├── core-partialx.md
│   │   ├── core-partitionby.md
│   │   ├── core-partitionbyerr.md
│   │   ├── core-pascalcase.md
│   │   ├── core-pickby.md
│   │   ├── core-pickbyerr.md
│   │   ├── core-pickbykeys.md
│   │   ├── core-pickbyvalues.md
│   │   ├── core-product.md
│   │   ├── core-productby.md
│   │   ├── core-productbyerr.md
│   │   ├── core-randomstring.md
│   │   ├── core-range.md
│   │   ├── core-rangefrom.md
│   │   ├── core-rangewithsteps.md
│   │   ├── core-reduce.md
│   │   ├── core-reduceerr.md
│   │   ├── core-reduceright.md
│   │   ├── core-reducerighterr.md
│   │   ├── core-reject.md
│   │   ├── core-rejecterr.md
│   │   ├── core-rejectmap.md
│   │   ├── core-repeat.md
│   │   ├── core-repeatby.md
│   │   ├── core-repeatbyerr.md
│   │   ├── core-replace.md
│   │   ├── core-replaceall.md
│   │   ├── core-reverse.md
│   │   ├── core-runelength.md
│   │   ├── core-sample.md
│   │   ├── core-sampleby.md
│   │   ├── core-samples.md
│   │   ├── core-samplesby.md
│   │   ├── core-shuffle.md
│   │   ├── core-slice.md
│   │   ├── core-slicetochannel.md
│   │   ├── core-slicetomap.md
│   │   ├── core-sliding.md
│   │   ├── core-snakecase.md
│   │   ├── core-some.md
│   │   ├── core-someby.md
│   │   ├── core-splice.md
│   │   ├── core-subset.md
│   │   ├── core-substring.md
│   │   ├── core-sum.md
│   │   ├── core-sumby.md
│   │   ├── core-sumbyerr.md
│   │   ├── core-switch.md
│   │   ├── core-synchronize.md
│   │   ├── core-take.md
│   │   ├── core-takefilter.md
│   │   ├── core-takewhile.md
│   │   ├── core-ternary.md
│   │   ├── core-times.md
│   │   ├── core-toanyslice.md
│   │   ├── core-topairs.md
│   │   ├── core-toptr.md
│   │   ├── core-tosliceptr.md
│   │   ├── core-trim.md
│   │   ├── core-trimleft.md
│   │   ├── core-trimprefix.md
│   │   ├── core-trimright.md
│   │   ├── core-trimsuffix.md
│   │   ├── core-trycatch.md
│   │   ├── core-trycatchwitherrorvalue.md
│   │   ├── core-tryorx.md
│   │   ├── core-trywitherrorvalue.md
│   │   ├── core-tryx.md
│   │   ├── core-tuplex.md
│   │   ├── core-union.md
│   │   ├── core-uniq.md
│   │   ├── core-uniqby.md
│   │   ├── core-uniqbyerr.md
│   │   ├── core-uniqkeys.md
│   │   ├── core-uniqmap.md
│   │   ├── core-uniqvalues.md
│   │   ├── core-unpackx.md
│   │   ├── core-unzipbyerrx.md
│   │   ├── core-unzipbyx.md
│   │   ├── core-unzipx.md
│   │   ├── core-validate.md
│   │   ├── core-valueor.md
│   │   ├── core-values.md
│   │   ├── core-waitfor.md
│   │   ├── core-window.md
│   │   ├── core-without.md
│   │   ├── core-withoutby.md
│   │   ├── core-withoutbyerr.md
│   │   ├── core-withoutempty.md
│   │   ├── core-withoutnth.md
│   │   ├── core-words.md
│   │   ├── core-zipbyerrx.md
│   │   ├── core-zipbyx.md
│   │   ├── core-zipx.md
│   │   ├── it-assign.md
│   │   ├── it-associate.md
│   │   ├── it-buffer.md
│   │   ├── it-channelseq.md
│   │   ├── it-channeltoseq.md
│   │   ├── it-chunk.md
│   │   ├── it-chunkentries.md
│   │   ├── it-chunkstring.md
│   │   ├── it-coalesceseq.md
│   │   ├── it-coalesceseqorempty.md
│   │   ├── it-compact.md
│   │   ├── it-concat.md
│   │   ├── it-contains.md
│   │   ├── it-containsby.md
│   │   ├── it-count.md
│   │   ├── it-countby.md
│   │   ├── it-countvalues.md
│   │   ├── it-countvaluesby.md
│   │   ├── it-crossjoinbyx.md
│   │   ├── it-crossjoinx.md
│   │   ├── it-cutprefix.md
│   │   ├── it-cutsuffix.md
│   │   ├── it-drain.md
│   │   ├── it-drop.md
│   │   ├── it-dropbyindex.md
│   │   ├── it-droplast.md
│   │   ├── it-droplastwhile.md
│   │   ├── it-dropslice.md
│   │   ├── it-dropwhile.md
│   │   ├── it-earliest.md
│   │   ├── it-earliestby.md
│   │   ├── it-elementsmatch.md
│   │   ├── it-elementsmatchby.md
│   │   ├── it-empty.md
│   │   ├── it-entries.md
│   │   ├── it-every.md
│   │   ├── it-everyby.md
│   │   ├── it-fill.md
│   │   ├── it-filter.md
│   │   ├── it-filterkeys.md
│   │   ├── it-filtermap.md
│   │   ├── it-filtermaptoseq.md
│   │   ├── it-filtervalues.md
│   │   ├── it-find.md
│   │   ├── it-findduplicates.md
│   │   ├── it-findduplicatesby.md
│   │   ├── it-findindexof.md
│   │   ├── it-findlastindexof.md
│   │   ├── it-findorelse.md
│   │   ├── it-finduniques.md
│   │   ├── it-finduniquesby.md
│   │   ├── it-first.md
│   │   ├── it-firstor.md
│   │   ├── it-firstorempty.md
│   │   ├── it-flatmap.md
│   │   ├── it-flatten.md
│   │   ├── it-foreach.md
│   │   ├── it-foreachwhile.md
│   │   ├── it-fromanyseq.md
│   │   ├── it-fromentries.md
│   │   ├── it-frompairs.md
│   │   ├── it-fromseqptr.md
│   │   ├── it-fromseqptror.md
│   │   ├── it-groupby.md
│   │   ├── it-hasprefix.md
│   │   ├── it-hassuffix.md
│   │   ├── it-indexof.md
│   │   ├── it-interleave.md
│   │   ├── it-intersect.md
│   │   ├── it-intersectby.md
│   │   ├── it-invert.md
│   │   ├── it-isempty.md
│   │   ├── it-isnotempty.md
│   │   ├── it-issorted.md
│   │   ├── it-issortedby.md
│   │   ├── it-keyby.md
│   │   ├── it-keyify.md
│   │   ├── it-keys.md
│   │   ├── it-last.md
│   │   ├── it-lastindexof.md
│   │   ├── it-lastor.md
│   │   ├── it-lastorempty.md
│   │   ├── it-latest.md
│   │   ├── it-latestby.md
│   │   ├── it-length.md
│   │   ├── it-map.md
│   │   ├── it-maptoseq.md
│   │   ├── it-max.md
│   │   ├── it-maxby.md
│   │   ├── it-maxindex.md
│   │   ├── it-maxindexby.md
│   │   ├── it-mean.md
│   │   ├── it-meanby.md
│   │   ├── it-min.md
│   │   ├── it-minby.md
│   │   ├── it-minindex.md
│   │   ├── it-minindexby.md
│   │   ├── it-mode.md
│   │   ├── it-none.md
│   │   ├── it-noneby.md
│   │   ├── it-nth.md
│   │   ├── it-nthor.md
│   │   ├── it-nthorempty.md
│   │   ├── it-partitionby.md
│   │   ├── it-product.md
│   │   ├── it-productby.md
│   │   ├── it-range.md
│   │   ├── it-rangefrom.md
│   │   ├── it-rangewithsteps.md
│   │   ├── it-reduce.md
│   │   ├── it-reducelast.md
│   │   ├── it-reject.md
│   │   ├── it-rejectmap.md
│   │   ├── it-repeat.md
│   │   ├── it-repeatby.md
│   │   ├── it-replace.md
│   │   ├── it-replaceall.md
│   │   ├── it-reverse.md
│   │   ├── it-sample.md
│   │   ├── it-sampleby.md
│   │   ├── it-samples.md
│   │   ├── it-samplesby.md
│   │   ├── it-seqtochannel.md
│   │   ├── it-sequencestate.md
│   │   ├── it-shuffle.md
│   │   ├── it-slice.md
│   │   ├── it-sliding.md
│   │   ├── it-some.md
│   │   ├── it-someby.md
│   │   ├── it-splice.md
│   │   ├── it-subset.md
│   │   ├── it-sum.md
│   │   ├── it-sumby.md
│   │   ├── it-take.md
│   │   ├── it-takefilter.md
│   │   ├── it-takewhile.md
│   │   ├── it-times.md
│   │   ├── it-toanyseq.md
│   │   ├── it-toseqptr.md
│   │   ├── it-trim.md
│   │   ├── it-trimfirst.md
│   │   ├── it-trimlast.md
│   │   ├── it-trimprefix.md
│   │   ├── it-trimsuffix.md
│   │   ├── it-union.md
│   │   ├── it-uniq.md
│   │   ├── it-uniqby.md
│   │   ├── it-uniqkeys.md
│   │   ├── it-uniqvalues.md
│   │   ├── it-values.md
│   │   ├── it-window.md
│   │   ├── it-without.md
│   │   ├── it-withoutby.md
│   │   ├── it-withoutnth.md
│   │   ├── it-zipbyx.md
│   │   ├── it-zipx.md
│   │   ├── mutable-fill.md
│   │   ├── mutable-filter.md
│   │   ├── mutable-map.md
│   │   ├── mutable-reverse.md
│   │   ├── mutable-shuffle.md
│   │   ├── parallel-foreach.md
│   │   ├── parallel-groupby.md
│   │   ├── parallel-map.md
│   │   ├── parallel-partitionby.md
│   │   ├── parallel-times.md
│   │   ├── simd-clamp.md
│   │   ├── simd-contains.md
│   │   ├── simd-max.md
│   │   ├── simd-mean.md
│   │   ├── simd-meanby.md
│   │   ├── simd-min.md
│   │   ├── simd-sum.md
│   │   └── simd-sumby.md
│   ├── docs/
│   │   ├── _category_.json
│   │   ├── about.md
│   │   ├── contributing.md
│   │   ├── core/
│   │   │   ├── _category_.json
│   │   │   ├── channel.md
│   │   │   ├── concurrency.md
│   │   │   ├── condition.md
│   │   │   ├── error-handling.md
│   │   │   ├── find.md
│   │   │   ├── function.md
│   │   │   ├── intersect.md
│   │   │   ├── map.md
│   │   │   ├── math.md
│   │   │   ├── retry.md
│   │   │   ├── slice.md
│   │   │   ├── string.md
│   │   │   ├── time.md
│   │   │   ├── tuple.md
│   │   │   └── type.md
│   │   ├── experimental/
│   │   │   ├── _category_.json
│   │   │   └── simd.md
│   │   ├── getting-started.md
│   │   ├── glossary.md
│   │   ├── iter/
│   │   │   ├── _category_.json
│   │   │   ├── channel.md
│   │   │   ├── find.md
│   │   │   ├── intersect.md
│   │   │   ├── map.md
│   │   │   ├── sequence.md
│   │   │   ├── slice.md
│   │   │   ├── string.md
│   │   │   ├── tuple.md
│   │   │   └── type.md
│   │   ├── mutable/
│   │   │   ├── _category_.json
│   │   │   └── slice.md
│   │   └── parallel/
│   │       ├── _category_.json
│   │       └── slice.md
│   ├── docusaurus.config.ts
│   ├── package.json
│   ├── plugins/
│   │   └── helpers-pages/
│   │       ├── components/
│   │       │   ├── HelperCard.tsx
│   │       │   ├── HelperList.tsx
│   │       │   ├── HelperTOC.tsx
│   │       │   ├── helper-components.css
│   │       │   └── highlightPrototypeGenerics.ts
│   │       └── index.ts
│   ├── scripts/
│   │   ├── check-cross-references.js
│   │   ├── check-duplicates-in-category.js
│   │   ├── check-filename-matches-frontmatter.js
│   │   ├── check-function-signatures.js
│   │   ├── check-helpers-visible-in-pages.js
│   │   ├── check-similar-exists.js
│   │   ├── check-similar-keys-exist-in-directory.js
│   │   └── utils.js
│   ├── sidebars.ts
│   ├── src/
│   │   ├── css/
│   │   │   └── custom.css
│   │   ├── pages/
│   │   │   ├── community.module.css
│   │   │   ├── community.tsx
│   │   │   ├── index.module.css
│   │   │   └── index.tsx
│   │   ├── prism-include-languages.js
│   │   └── theme/
│   │       ├── DocSidebar/
│   │       │   └── index.tsx
│   │       ├── NotFound/
│   │       │   └── index.tsx
│   │       └── prism-include-languages.js
│   ├── static/
│   │   ├── .nojekyll
│   │   ├── img/
│   │   │   ├── README.md
│   │   │   ├── logo-full.xcf
│   │   │   └── social-preview.xcf
│   │   └── llms.txt
│   └── tsconfig.json
├── errors.go
├── errors_test.go
├── exp/
│   └── simd/
│       ├── BENCHMARK.md
│       ├── README.md
│       ├── cpu_amd64.go
│       ├── cpu_amd64_test.go
│       ├── go.mod
│       ├── go.sum
│       ├── intersect_avx512.go
│       ├── intersect_avx512_test.go
│       ├── intersect_bench_test.go
│       ├── math.go
│       ├── math_avx.go
│       ├── math_avx2.go
│       ├── math_avx2_test.go
│       ├── math_avx512.go
│       ├── math_avx512_test.go
│       ├── math_avx_test.go
│       ├── math_bench_test.go
│       ├── simd.go
│       ├── simd_test.go
│       └── unsafe.go
├── find.go
├── find_test.go
├── func.go
├── func_test.go
├── go.mod
├── go.sum
├── internal/
│   ├── constraints/
│   │   ├── README.md
│   │   ├── constraints.go
│   │   ├── ordered_go118.go
│   │   └── ordered_go121.go
│   ├── xrand/
│   │   ├── ordered_go118.go
│   │   └── ordered_go122.go
│   └── xtime/
│       ├── README.md
│       ├── fake.go
│       ├── noCopy.go
│       ├── real.go
│       └── time.go
├── intersect.go
├── intersect_test.go
├── it/
│   ├── channel.go
│   ├── channel_test.go
│   ├── find.go
│   ├── find_example_test.go
│   ├── find_test.go
│   ├── intersect.go
│   ├── intersect_example_test.go
│   ├── intersect_test.go
│   ├── lo_test.go
│   ├── map.go
│   ├── map_example_test.go
│   ├── map_test.go
│   ├── math.go
│   ├── math_example_test.go
│   ├── math_test.go
│   ├── seq.go
│   ├── seq_example_test.go
│   ├── seq_test.go
│   ├── string.go
│   ├── string_example_test.go
│   ├── string_test.go
│   ├── tuples.go
│   ├── tuples_example_test.go
│   ├── tuples_test.go
│   ├── type_manipulation.go
│   └── type_manipulation_test.go
├── lo_example_test.go
├── lo_test.go
├── map.go
├── map_test.go
├── math.go
├── math_test.go
├── mutable/
│   ├── slice.go
│   ├── slice_example_test.go
│   └── slice_test.go
├── parallel/
│   ├── slice.go
│   └── slice_test.go
├── retry.go
├── retry_example_test.go
├── retry_test.go
├── slice.go
├── slice_test.go
├── string.go
├── string_test.go
├── time.go
├── time_test.go
├── tuples.go
├── tuples_test.go
├── type_manipulation.go
├── type_manipulation_test.go
└── types.go
Download .txt
Showing preview only (228K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2669 symbols across 120 files)

FILE: benchmark/core_condition_bench_test.go
  function BenchmarkIf (line 9) | func BenchmarkIf(b *testing.B) {
  function BenchmarkIfElseIf (line 15) | func BenchmarkIfElseIf(b *testing.B) {
  function BenchmarkIfElseIfChain (line 23) | func BenchmarkIfElseIfChain(b *testing.B) {
  function BenchmarkSwitch (line 33) | func BenchmarkSwitch(b *testing.B) {
  function BenchmarkSwitchChain (line 42) | func BenchmarkSwitchChain(b *testing.B) {

FILE: benchmark/core_find_bench_test.go
  function BenchmarkIndexOf (line 10) | func BenchmarkIndexOf(b *testing.B) {
  function BenchmarkLastIndexOf (line 22) | func BenchmarkLastIndexOf(b *testing.B) {
  function BenchmarkHasPrefix (line 34) | func BenchmarkHasPrefix(b *testing.B) {
  function BenchmarkHasSuffix (line 46) | func BenchmarkHasSuffix(b *testing.B) {
  function BenchmarkFind (line 58) | func BenchmarkFind(b *testing.B) {
  function BenchmarkFindIndexOf (line 70) | func BenchmarkFindIndexOf(b *testing.B) {
  function BenchmarkFindLastIndexOf (line 82) | func BenchmarkFindLastIndexOf(b *testing.B) {
  function BenchmarkFindOrElse (line 94) | func BenchmarkFindOrElse(b *testing.B) {
  function BenchmarkFindKey (line 105) | func BenchmarkFindKey(b *testing.B) {
  function BenchmarkFindKeyBy (line 116) | func BenchmarkFindKeyBy(b *testing.B) {
  function BenchmarkFindUniques (line 127) | func BenchmarkFindUniques(b *testing.B) {
  function BenchmarkFindUniquesBy (line 138) | func BenchmarkFindUniquesBy(b *testing.B) {
  function BenchmarkFindDuplicates (line 149) | func BenchmarkFindDuplicates(b *testing.B) {
  function BenchmarkFindDuplicatesBy (line 160) | func BenchmarkFindDuplicatesBy(b *testing.B) {
  function BenchmarkMin (line 171) | func BenchmarkMin(b *testing.B) {
  function BenchmarkMinIndex (line 182) | func BenchmarkMinIndex(b *testing.B) {
  function BenchmarkMinBy (line 193) | func BenchmarkMinBy(b *testing.B) {
  function BenchmarkMinIndexBy (line 204) | func BenchmarkMinIndexBy(b *testing.B) {
  function BenchmarkMax (line 215) | func BenchmarkMax(b *testing.B) {
  function BenchmarkMaxIndex (line 226) | func BenchmarkMaxIndex(b *testing.B) {
  function BenchmarkMaxBy (line 237) | func BenchmarkMaxBy(b *testing.B) {
  function BenchmarkMaxIndexBy (line 248) | func BenchmarkMaxIndexBy(b *testing.B) {
  function BenchmarkFirst (line 259) | func BenchmarkFirst(b *testing.B) {
  function BenchmarkFirstOrEmpty (line 266) | func BenchmarkFirstOrEmpty(b *testing.B) {
  function BenchmarkLast (line 273) | func BenchmarkLast(b *testing.B) {
  function BenchmarkLastOrEmpty (line 280) | func BenchmarkLastOrEmpty(b *testing.B) {
  function BenchmarkNth (line 287) | func BenchmarkNth(b *testing.B) {
  function BenchmarkSample (line 294) | func BenchmarkSample(b *testing.B) {
  function BenchmarkSamples (line 301) | func BenchmarkSamples(b *testing.B) {

FILE: benchmark/core_intersect_bench_test.go
  function BenchmarkContains (line 10) | func BenchmarkContains(b *testing.B) {
  function BenchmarkContainsBy (line 22) | func BenchmarkContainsBy(b *testing.B) {
  function BenchmarkEvery (line 34) | func BenchmarkEvery(b *testing.B) {
  function BenchmarkEveryBy (line 46) | func BenchmarkEveryBy(b *testing.B) {
  function BenchmarkSome (line 57) | func BenchmarkSome(b *testing.B) {
  function BenchmarkSomeBy (line 69) | func BenchmarkSomeBy(b *testing.B) {
  function BenchmarkNone (line 80) | func BenchmarkNone(b *testing.B) {
  function BenchmarkNoneBy (line 92) | func BenchmarkNoneBy(b *testing.B) {
  function BenchmarkIntersect (line 103) | func BenchmarkIntersect(b *testing.B) {
  function BenchmarkIntersectBy (line 115) | func BenchmarkIntersectBy(b *testing.B) {
  function BenchmarkUnion (line 127) | func BenchmarkUnion(b *testing.B) {
  function BenchmarkWithout (line 139) | func BenchmarkWithout(b *testing.B) {
  function BenchmarkWithoutBy (line 150) | func BenchmarkWithoutBy(b *testing.B) {
  function BenchmarkWithoutEmpty (line 161) | func BenchmarkWithoutEmpty(b *testing.B) {
  function BenchmarkWithoutNth (line 176) | func BenchmarkWithoutNth(b *testing.B) {
  function BenchmarkElementsMatch (line 187) | func BenchmarkElementsMatch(b *testing.B) {

FILE: benchmark/core_map_bench_test.go
  function BenchmarkKeys (line 12) | func BenchmarkKeys(b *testing.B) {
  function BenchmarkUniqKeys (line 23) | func BenchmarkUniqKeys(b *testing.B) {
  function BenchmarkHasKey (line 35) | func BenchmarkHasKey(b *testing.B) {
  function BenchmarkValues (line 47) | func BenchmarkValues(b *testing.B) {
  function BenchmarkUniqValues (line 58) | func BenchmarkUniqValues(b *testing.B) {
  function BenchmarkValueOr (line 71) | func BenchmarkValueOr(b *testing.B) {
  function BenchmarkPickBy (line 85) | func BenchmarkPickBy(b *testing.B) {
  function BenchmarkPickByKeys (line 96) | func BenchmarkPickByKeys(b *testing.B) {
  function BenchmarkPickByValues (line 111) | func BenchmarkPickByValues(b *testing.B) {
  function BenchmarkOmitBy (line 126) | func BenchmarkOmitBy(b *testing.B) {
  function BenchmarkOmitByKeys (line 137) | func BenchmarkOmitByKeys(b *testing.B) {
  function BenchmarkOmitByValues (line 152) | func BenchmarkOmitByValues(b *testing.B) {
  function BenchmarkEntries (line 167) | func BenchmarkEntries(b *testing.B) {
  function BenchmarkFromEntries (line 178) | func BenchmarkFromEntries(b *testing.B) {
  function BenchmarkInvert (line 192) | func BenchmarkInvert(b *testing.B) {
  function BenchmarkAssign (line 203) | func BenchmarkAssign(b *testing.B) {
  function BenchmarkChunkEntries (line 215) | func BenchmarkChunkEntries(b *testing.B) {
  function BenchmarkMapKeys (line 226) | func BenchmarkMapKeys(b *testing.B) {
  function BenchmarkMapValues (line 237) | func BenchmarkMapValues(b *testing.B) {
  function BenchmarkMapEntries (line 248) | func BenchmarkMapEntries(b *testing.B) {
  function BenchmarkMapToSlice (line 259) | func BenchmarkMapToSlice(b *testing.B) {
  function BenchmarkFilterMapToSlice (line 270) | func BenchmarkFilterMapToSlice(b *testing.B) {
  function BenchmarkFilterKeys (line 281) | func BenchmarkFilterKeys(b *testing.B) {
  function BenchmarkFilterValues (line 290) | func BenchmarkFilterValues(b *testing.B) {
  function BenchmarkMapComparison (line 303) | func BenchmarkMapComparison(b *testing.B) {

FILE: benchmark/core_math_bench_test.go
  function BenchmarkRange (line 10) | func BenchmarkRange(b *testing.B) {
  function BenchmarkRangeFrom (line 20) | func BenchmarkRangeFrom(b *testing.B) {
  function BenchmarkRangeWithSteps (line 30) | func BenchmarkRangeWithSteps(b *testing.B) {
  function BenchmarkClamp (line 40) | func BenchmarkClamp(b *testing.B) {
  function BenchmarkSum (line 46) | func BenchmarkSum(b *testing.B) {
  function BenchmarkSumBy (line 57) | func BenchmarkSumBy(b *testing.B) {
  function BenchmarkProduct (line 68) | func BenchmarkProduct(b *testing.B) {
  function BenchmarkProductBy (line 82) | func BenchmarkProductBy(b *testing.B) {
  function BenchmarkMean (line 93) | func BenchmarkMean(b *testing.B) {
  function BenchmarkMeanBy (line 104) | func BenchmarkMeanBy(b *testing.B) {
  function BenchmarkMode (line 115) | func BenchmarkMode(b *testing.B) {

FILE: benchmark/core_slice_bench_test.go
  function BenchmarkChunk (line 12) | func BenchmarkChunk(b *testing.B) {
  function BenchmarkFlatten (line 32) | func BenchmarkFlatten(b *testing.B) {
  function BenchmarkDrop (line 58) | func BenchmarkDrop(b *testing.B) {
  function BenchmarkDropRight (line 78) | func BenchmarkDropRight(b *testing.B) {
  function BenchmarkDropWhile (line 98) | func BenchmarkDropWhile(b *testing.B) {
  function BenchmarkDropRightWhile (line 118) | func BenchmarkDropRightWhile(b *testing.B) {
  function BenchmarkDropByIndex (line 138) | func BenchmarkDropByIndex(b *testing.B) {
  function BenchmarkReplace (line 171) | func BenchmarkReplace(b *testing.B) {
  function BenchmarkReject (line 192) | func BenchmarkReject(b *testing.B) {
  function BenchmarkRejectErr (line 212) | func BenchmarkRejectErr(b *testing.B) {
  function BenchmarkRejectMap (line 232) | func BenchmarkRejectMap(b *testing.B) {
  function BenchmarkUniqMap (line 252) | func BenchmarkUniqMap(b *testing.B) {
  function BenchmarkRepeatBy (line 272) | func BenchmarkRepeatBy(b *testing.B) {
  function BenchmarkFill (line 290) | func BenchmarkFill(b *testing.B) {
  function BenchmarkRepeat (line 304) | func BenchmarkRepeat(b *testing.B) {
  function BenchmarkFilter (line 314) | func BenchmarkFilter(b *testing.B) {
  function BenchmarkFilterErr (line 325) | func BenchmarkFilterErr(b *testing.B) {
  function BenchmarkSliceMap (line 336) | func BenchmarkSliceMap(b *testing.B) {
  function BenchmarkMapErr (line 347) | func BenchmarkMapErr(b *testing.B) {
  function BenchmarkFilterMap (line 358) | func BenchmarkFilterMap(b *testing.B) {
  function BenchmarkFlatMap (line 369) | func BenchmarkFlatMap(b *testing.B) {
  function BenchmarkReduce (line 380) | func BenchmarkReduce(b *testing.B) {
  function BenchmarkReduceRight (line 391) | func BenchmarkReduceRight(b *testing.B) {
  function BenchmarkForEach (line 402) | func BenchmarkForEach(b *testing.B) {
  function BenchmarkForEachWhile (line 413) | func BenchmarkForEachWhile(b *testing.B) {
  function BenchmarkTimes (line 424) | func BenchmarkTimes(b *testing.B) {
  function BenchmarkUniq (line 434) | func BenchmarkUniq(b *testing.B) {
  function BenchmarkUniqBy (line 445) | func BenchmarkUniqBy(b *testing.B) {
  function BenchmarkGroupBy (line 456) | func BenchmarkGroupBy(b *testing.B) {
  function BenchmarkGroupByMap (line 467) | func BenchmarkGroupByMap(b *testing.B) {
  function BenchmarkPartitionBy (line 478) | func BenchmarkPartitionBy(b *testing.B) {
  function BenchmarkConcat (line 489) | func BenchmarkConcat(b *testing.B) {
  function BenchmarkWindow (line 501) | func BenchmarkWindow(b *testing.B) {
  function BenchmarkSliding (line 512) | func BenchmarkSliding(b *testing.B) {
  function BenchmarkInterleave (line 523) | func BenchmarkInterleave(b *testing.B) {
  function BenchmarkShuffle (line 535) | func BenchmarkShuffle(b *testing.B) {
  function BenchmarkReverse (line 546) | func BenchmarkReverse(b *testing.B) {
  function BenchmarkRepeatByErr (line 557) | func BenchmarkRepeatByErr(b *testing.B) {
  function BenchmarkKeyBy (line 567) | func BenchmarkKeyBy(b *testing.B) {
  function BenchmarkAssociate (line 578) | func BenchmarkAssociate(b *testing.B) {
  function BenchmarkSliceToMap (line 589) | func BenchmarkSliceToMap(b *testing.B) {
  function BenchmarkFilterSliceToMap (line 600) | func BenchmarkFilterSliceToMap(b *testing.B) {
  function BenchmarkKeyify (line 611) | func BenchmarkKeyify(b *testing.B) {
  function BenchmarkTake (line 622) | func BenchmarkTake(b *testing.B) {
  function BenchmarkTakeWhile (line 633) | func BenchmarkTakeWhile(b *testing.B) {
  function BenchmarkTakeFilter (line 644) | func BenchmarkTakeFilter(b *testing.B) {
  function BenchmarkFilterReject (line 655) | func BenchmarkFilterReject(b *testing.B) {
  function BenchmarkCount (line 666) | func BenchmarkCount(b *testing.B) {
  function BenchmarkCountBy (line 677) | func BenchmarkCountBy(b *testing.B) {
  function BenchmarkCountValues (line 688) | func BenchmarkCountValues(b *testing.B) {
  function BenchmarkCountValuesBy (line 699) | func BenchmarkCountValuesBy(b *testing.B) {
  function BenchmarkSubset (line 710) | func BenchmarkSubset(b *testing.B) {
  function BenchmarkSlice (line 721) | func BenchmarkSlice(b *testing.B) {
  function BenchmarkReplaceAll (line 732) | func BenchmarkReplaceAll(b *testing.B) {
  function BenchmarkClone (line 743) | func BenchmarkClone(b *testing.B) {
  function BenchmarkCompact (line 754) | func BenchmarkCompact(b *testing.B) {
  function BenchmarkIsSorted (line 765) | func BenchmarkIsSorted(b *testing.B) {
  function BenchmarkIsSortedBy (line 776) | func BenchmarkIsSortedBy(b *testing.B) {
  function BenchmarkIsSortedBySorted (line 787) | func BenchmarkIsSortedBySorted(b *testing.B) {
  function BenchmarkSplice (line 799) | func BenchmarkSplice(b *testing.B) {
  function BenchmarkCut (line 811) | func BenchmarkCut(b *testing.B) {
  function BenchmarkCutPrefix (line 823) | func BenchmarkCutPrefix(b *testing.B) {
  function BenchmarkCutSuffix (line 835) | func BenchmarkCutSuffix(b *testing.B) {
  function BenchmarkTrim (line 847) | func BenchmarkTrim(b *testing.B) {
  function BenchmarkTrimLeft (line 859) | func BenchmarkTrimLeft(b *testing.B) {
  function BenchmarkTrimRight (line 871) | func BenchmarkTrimRight(b *testing.B) {
  function BenchmarkTrimPrefix (line 883) | func BenchmarkTrimPrefix(b *testing.B) {
  function BenchmarkTrimSuffix (line 895) | func BenchmarkTrimSuffix(b *testing.B) {
  function BenchmarkFilterTakeVsFilterAndTake (line 907) | func BenchmarkFilterTakeVsFilterAndTake(b *testing.B) {
  function BenchmarkDifference (line 955) | func BenchmarkDifference(b *testing.B) {
  function BenchmarkFromSlicePtr (line 977) | func BenchmarkFromSlicePtr(b *testing.B) {
  function BenchmarkFromSlicePtrOr (line 997) | func BenchmarkFromSlicePtrOr(b *testing.B) {

FILE: benchmark/core_string_bench_test.go
  function BenchmarkRandomString (line 9) | func BenchmarkRandomString(b *testing.B) {
  function BenchmarkSubstring (line 15) | func BenchmarkSubstring(b *testing.B) {
  function BenchmarkChunkString (line 22) | func BenchmarkChunkString(b *testing.B) {
  function BenchmarkRuneLength (line 29) | func BenchmarkRuneLength(b *testing.B) {
  function BenchmarkPascalCase (line 36) | func BenchmarkPascalCase(b *testing.B) {
  function BenchmarkCamelCase (line 42) | func BenchmarkCamelCase(b *testing.B) {
  function BenchmarkKebabCase (line 48) | func BenchmarkKebabCase(b *testing.B) {
  function BenchmarkSnakeCase (line 54) | func BenchmarkSnakeCase(b *testing.B) {
  function BenchmarkWords (line 60) | func BenchmarkWords(b *testing.B) {
  function BenchmarkCapitalize (line 66) | func BenchmarkCapitalize(b *testing.B) {
  function BenchmarkEllipsis (line 72) | func BenchmarkEllipsis(b *testing.B) {

FILE: benchmark/core_tuples_bench_test.go
  function BenchmarkZip2_Equal (line 10) | func BenchmarkZip2_Equal(b *testing.B) {
  function BenchmarkZip2_Unequal (line 22) | func BenchmarkZip2_Unequal(b *testing.B) {
  function BenchmarkUnzip2 (line 34) | func BenchmarkUnzip2(b *testing.B) {

FILE: benchmark/core_type_manipulation_bench_test.go
  function BenchmarkToPtr (line 10) | func BenchmarkToPtr(b *testing.B) {
  function BenchmarkFromPtr (line 16) | func BenchmarkFromPtr(b *testing.B) {
  function BenchmarkFromPtrOr (line 23) | func BenchmarkFromPtrOr(b *testing.B) {
  function BenchmarkToSlicePtr (line 30) | func BenchmarkToSlicePtr(b *testing.B) {
  function BenchmarkToAnySlice (line 41) | func BenchmarkToAnySlice(b *testing.B) {
  function BenchmarkFromAnySlice (line 52) | func BenchmarkFromAnySlice(b *testing.B) {
  function BenchmarkIsEmpty (line 63) | func BenchmarkIsEmpty(b *testing.B) {
  function BenchmarkIsNotEmpty (line 69) | func BenchmarkIsNotEmpty(b *testing.B) {
  function BenchmarkCoalesce (line 75) | func BenchmarkCoalesce(b *testing.B) {

FILE: benchmark/helpers_test.go
  function genSliceString (line 11) | func genSliceString(n int) []string {
  function genSliceInt (line 19) | func genSliceInt(n int) []int {
  function genSliceHeavy (line 29) | func genSliceHeavy(n int) []heavy {
  function genMap (line 39) | func genMap(n int) map[string]int {
  type clonableString (line 47) | type clonableString struct
    method Clone (line 51) | func (c clonableString) Clone() clonableString {
  function sliceGenerator (line 56) | func sliceGenerator(size uint) []int64 {
  function mapGenerator (line 69) | func mapGenerator(size uint) map[int64]int64 {

FILE: benchmark/it_find_bench_test.go
  function BenchmarkItFind (line 13) | func BenchmarkItFind(b *testing.B) {
  function BenchmarkItContains (line 24) | func BenchmarkItContains(b *testing.B) {
  function BenchmarkItContainsBy (line 35) | func BenchmarkItContainsBy(b *testing.B) {
  function BenchmarkItEvery (line 47) | func BenchmarkItEvery(b *testing.B) {
  function BenchmarkItEveryBy (line 58) | func BenchmarkItEveryBy(b *testing.B) {
  function BenchmarkItSome (line 69) | func BenchmarkItSome(b *testing.B) {
  function BenchmarkItSomeBy (line 80) | func BenchmarkItSomeBy(b *testing.B) {
  function BenchmarkItNone (line 92) | func BenchmarkItNone(b *testing.B) {
  function BenchmarkItNoneBy (line 103) | func BenchmarkItNoneBy(b *testing.B) {
  function BenchmarkItIntersect (line 115) | func BenchmarkItIntersect(b *testing.B) {
  function BenchmarkItUnion (line 128) | func BenchmarkItUnion(b *testing.B) {
  function BenchmarkItWithout (line 141) | func BenchmarkItWithout(b *testing.B) {
  function BenchmarkItWithoutNth (line 153) | func BenchmarkItWithoutNth(b *testing.B) {
  function BenchmarkItIndexOf (line 165) | func BenchmarkItIndexOf(b *testing.B) {
  function BenchmarkItLastIndexOf (line 176) | func BenchmarkItLastIndexOf(b *testing.B) {
  function BenchmarkItHasPrefix (line 187) | func BenchmarkItHasPrefix(b *testing.B) {
  function BenchmarkItHasSuffix (line 198) | func BenchmarkItHasSuffix(b *testing.B) {
  function BenchmarkItFindIndexOf (line 209) | func BenchmarkItFindIndexOf(b *testing.B) {
  function BenchmarkItFindOrElse (line 220) | func BenchmarkItFindOrElse(b *testing.B) {
  function BenchmarkItFindUniques (line 231) | func BenchmarkItFindUniques(b *testing.B) {
  function BenchmarkItFindDuplicates (line 243) | func BenchmarkItFindDuplicates(b *testing.B) {
  function BenchmarkItMin (line 255) | func BenchmarkItMin(b *testing.B) {
  function BenchmarkItMax (line 266) | func BenchmarkItMax(b *testing.B) {
  function BenchmarkItMinBy (line 277) | func BenchmarkItMinBy(b *testing.B) {
  function BenchmarkItMaxBy (line 288) | func BenchmarkItMaxBy(b *testing.B) {
  function BenchmarkItFirst (line 299) | func BenchmarkItFirst(b *testing.B) {
  function BenchmarkItLast (line 310) | func BenchmarkItLast(b *testing.B) {
  function BenchmarkItNth (line 321) | func BenchmarkItNth(b *testing.B) {
  function BenchmarkItSample (line 332) | func BenchmarkItSample(b *testing.B) {
  function BenchmarkItSamples (line 343) | func BenchmarkItSamples(b *testing.B) {

FILE: benchmark/it_helpers_test.go
  function genStrings (line 13) | func genStrings(n int) iter.Seq[string] {
  function genInts (line 23) | func genInts(n int) iter.Seq[int] {
  function genIntPtrSeq (line 33) | func genIntPtrSeq(n int) iter.Seq[*int] {
  function genMapStringInt (line 44) | func genMapStringInt(n int) map[string]int {
  function genMapSeq (line 52) | func genMapSeq(n int) iter.Seq[map[string]int] {

FILE: benchmark/it_map_bench_test.go
  function BenchmarkItKeys (line 13) | func BenchmarkItKeys(b *testing.B) {
  function BenchmarkItUniqKeys (line 25) | func BenchmarkItUniqKeys(b *testing.B) {
  function BenchmarkItValues (line 37) | func BenchmarkItValues(b *testing.B) {
  function BenchmarkItUniqValues (line 49) | func BenchmarkItUniqValues(b *testing.B) {
  function BenchmarkItEntries (line 61) | func BenchmarkItEntries(b *testing.B) {
  function BenchmarkItFromEntries (line 73) | func BenchmarkItFromEntries(b *testing.B) {
  function BenchmarkItInvert (line 85) | func BenchmarkItInvert(b *testing.B) {
  function BenchmarkItAssign (line 98) | func BenchmarkItAssign(b *testing.B) {
  function BenchmarkItFilterKeys (line 109) | func BenchmarkItFilterKeys(b *testing.B) {
  function BenchmarkItFilterValues (line 121) | func BenchmarkItFilterValues(b *testing.B) {
  function BenchmarkItChunkString (line 133) | func BenchmarkItChunkString(b *testing.B) {

FILE: benchmark/it_math_bench_test.go
  function BenchmarkItSum (line 12) | func BenchmarkItSum(b *testing.B) {
  function BenchmarkItSumBy (line 23) | func BenchmarkItSumBy(b *testing.B) {
  function BenchmarkItProduct (line 34) | func BenchmarkItProduct(b *testing.B) {
  function BenchmarkItMean (line 45) | func BenchmarkItMean(b *testing.B) {
  function BenchmarkItMode (line 56) | func BenchmarkItMode(b *testing.B) {
  function BenchmarkItRange (line 67) | func BenchmarkItRange(b *testing.B) {
  function BenchmarkItLength (line 78) | func BenchmarkItLength(b *testing.B) {

FILE: benchmark/it_slice_bench_test.go
  function BenchmarkItChunk (line 13) | func BenchmarkItChunk(b *testing.B) {
  function BenchmarkItFlatten (line 35) | func BenchmarkItFlatten(b *testing.B) {
  function BenchmarkItDrop (line 63) | func BenchmarkItDrop(b *testing.B) {
  function BenchmarkItDropWhile (line 85) | func BenchmarkItDropWhile(b *testing.B) {
  function BenchmarkItDropLastWhile (line 107) | func BenchmarkItDropLastWhile(b *testing.B) {
  function BenchmarkItDropByIndex (line 129) | func BenchmarkItDropByIndex(b *testing.B) {
  function BenchmarkItReplace (line 151) | func BenchmarkItReplace(b *testing.B) {
  function BenchmarkItTrim (line 175) | func BenchmarkItTrim(b *testing.B) {
  function BenchmarkItTrimSuffix (line 197) | func BenchmarkItTrimSuffix(b *testing.B) {
  function BenchmarkItFilter (line 219) | func BenchmarkItFilter(b *testing.B) {
  function BenchmarkItMap (line 231) | func BenchmarkItMap(b *testing.B) {
  function BenchmarkItUniqMap (line 243) | func BenchmarkItUniqMap(b *testing.B) {
  function BenchmarkItFilterMap (line 255) | func BenchmarkItFilterMap(b *testing.B) {
  function BenchmarkItFlatMap (line 267) | func BenchmarkItFlatMap(b *testing.B) {
  function BenchmarkItReduce (line 283) | func BenchmarkItReduce(b *testing.B) {
  function BenchmarkItForEach (line 294) | func BenchmarkItForEach(b *testing.B) {
  function BenchmarkItForEachWhile (line 305) | func BenchmarkItForEachWhile(b *testing.B) {
  function BenchmarkItTimes (line 316) | func BenchmarkItTimes(b *testing.B) {
  function BenchmarkItUniq (line 327) | func BenchmarkItUniq(b *testing.B) {
  function BenchmarkItUniqBy (line 339) | func BenchmarkItUniqBy(b *testing.B) {
  function BenchmarkItGroupBy (line 351) | func BenchmarkItGroupBy(b *testing.B) {
  function BenchmarkItPartitionBy (line 362) | func BenchmarkItPartitionBy(b *testing.B) {
  function BenchmarkItConcat (line 373) | func BenchmarkItConcat(b *testing.B) {
  function BenchmarkItInterleave (line 386) | func BenchmarkItInterleave(b *testing.B) {
  function BenchmarkItShuffle (line 399) | func BenchmarkItShuffle(b *testing.B) {
  function BenchmarkItReverse (line 411) | func BenchmarkItReverse(b *testing.B) {
  function BenchmarkItRepeatBy (line 423) | func BenchmarkItRepeatBy(b *testing.B) {
  function BenchmarkItKeyBy (line 434) | func BenchmarkItKeyBy(b *testing.B) {
  function BenchmarkItAssociate (line 445) | func BenchmarkItAssociate(b *testing.B) {
  function BenchmarkItTake (line 456) | func BenchmarkItTake(b *testing.B) {
  function BenchmarkItTakeWhile (line 468) | func BenchmarkItTakeWhile(b *testing.B) {
  function BenchmarkItTakeFilter (line 480) | func BenchmarkItTakeFilter(b *testing.B) {
  function BenchmarkItReject (line 492) | func BenchmarkItReject(b *testing.B) {
  function BenchmarkItRejectMap (line 504) | func BenchmarkItRejectMap(b *testing.B) {
  function BenchmarkItCount (line 516) | func BenchmarkItCount(b *testing.B) {
  function BenchmarkItCountBy (line 527) | func BenchmarkItCountBy(b *testing.B) {
  function BenchmarkItCountValues (line 538) | func BenchmarkItCountValues(b *testing.B) {
  function BenchmarkItCountValuesBy (line 549) | func BenchmarkItCountValuesBy(b *testing.B) {
  function BenchmarkItSubset (line 560) | func BenchmarkItSubset(b *testing.B) {
  function BenchmarkItSlice (line 572) | func BenchmarkItSlice(b *testing.B) {
  function BenchmarkItReplaceAll (line 584) | func BenchmarkItReplaceAll(b *testing.B) {
  function BenchmarkItCompact (line 596) | func BenchmarkItCompact(b *testing.B) {
  function BenchmarkItIsSorted (line 608) | func BenchmarkItIsSorted(b *testing.B) {
  function BenchmarkItSplice (line 619) | func BenchmarkItSplice(b *testing.B) {
  function BenchmarkItCutPrefix (line 631) | func BenchmarkItCutPrefix(b *testing.B) {
  function BenchmarkItBuffer (line 644) | func BenchmarkItBuffer(b *testing.B) {

FILE: benchmark/it_type_manipulation_bench_test.go
  function BenchmarkItToSeqPtr (line 12) | func BenchmarkItToSeqPtr(b *testing.B) {
  function BenchmarkItFromSeqPtr (line 24) | func BenchmarkItFromSeqPtr(b *testing.B) {
  function BenchmarkItToAnySeq (line 36) | func BenchmarkItToAnySeq(b *testing.B) {

FILE: benchmark/mutable_slice_bench_test.go
  function BenchmarkMutableFilter (line 10) | func BenchmarkMutableFilter(b *testing.B) {
  function BenchmarkMutableFilterI (line 23) | func BenchmarkMutableFilterI(b *testing.B) {
  function BenchmarkMutableMap (line 36) | func BenchmarkMutableMap(b *testing.B) {
  function BenchmarkMutableMapI (line 49) | func BenchmarkMutableMapI(b *testing.B) {
  function BenchmarkMutableShuffle (line 62) | func BenchmarkMutableShuffle(b *testing.B) {
  function BenchmarkMutableReverse (line 75) | func BenchmarkMutableReverse(b *testing.B) {

FILE: benchmark/parallel_slice_bench_test.go
  function BenchmarkParallelMap (line 10) | func BenchmarkParallelMap(b *testing.B) {
  function BenchmarkParallelForEach (line 21) | func BenchmarkParallelForEach(b *testing.B) {
  function BenchmarkParallelTimes (line 32) | func BenchmarkParallelTimes(b *testing.B) {
  function BenchmarkParallelGroupBy (line 42) | func BenchmarkParallelGroupBy(b *testing.B) {
  function BenchmarkParallelPartitionBy (line 53) | func BenchmarkParallelPartitionBy(b *testing.B) {

FILE: channel.go
  type DispatchingStrategy (line 12) | type DispatchingStrategy
  function ChannelDispatcher (line 18) | func ChannelDispatcher[T any](stream <-chan T, count, channelBufferCap i...
  function createChannels (line 40) | func createChannels[T any](count, channelBufferCap int) []chan T {
  function channelsToReadOnly (line 50) | func channelsToReadOnly[T any](children []chan T) []<-chan T {
  function closeChannels (line 60) | func closeChannels[T any](children []chan T) {
  function channelIsNotFull (line 66) | func channelIsNotFull[T any](ch <-chan T) bool {
  function DispatchingStrategyRoundRobin (line 73) | func DispatchingStrategyRoundRobin[T any](msg T, index uint64, channels ...
  function DispatchingStrategyRandom (line 88) | func DispatchingStrategyRandom[T any](msg T, index uint64, channels []<-...
  function DispatchingStrategyWeightedRandom (line 102) | func DispatchingStrategyWeightedRandom[T any](weights []int) Dispatching...
  function DispatchingStrategyFirst (line 126) | func DispatchingStrategyFirst[T any](msg T, index uint64, channels []<-c...
  function DispatchingStrategyLeast (line 140) | func DispatchingStrategyLeast[T any](msg T, index uint64, channels []<-c...
  function DispatchingStrategyMost (line 151) | func DispatchingStrategyMost[T any](msg T, index uint64, channels []<-ch...
  function SliceToChannel (line 161) | func SliceToChannel[T any](bufferSize int, collection []T) <-chan T {
  function ChannelToSlice (line 177) | func ChannelToSlice[T any](ch <-chan T) []T {
  function Generator (line 191) | func Generator[T any](bufferSize int, generator func(yield func(T))) <-c...
  function Buffer (line 209) | func Buffer[T any](ch <-chan T, size int) (collection []T, length int, r...
  function BufferWithContext (line 228) | func BufferWithContext[T any](ctx context.Context, ch <-chan T, size int...
  function BufferWithTimeout (line 251) | func BufferWithTimeout[T any](ch <-chan T, size int, timeout time.Durati...
  function FanIn (line 260) | func FanIn[T any](channelBufferCap int, upstreams ...<-chan T) <-chan T {
  function FanOut (line 287) | func FanOut[T any](count, channelsBufferCap int, upstream <-chan T) []<-...

FILE: channel_test.go
  function TestChannelDispatcher (line 11) | func TestChannelDispatcher(t *testing.T) {
  function TestDispatchingStrategyRoundRobin (line 99) | func TestDispatchingStrategyRoundRobin(t *testing.T) {
  function TestDispatchingStrategyRandom (line 114) | func TestDispatchingStrategyRandom(t *testing.T) {
  function TestDispatchingStrategyWeightedRandom (line 130) | func TestDispatchingStrategyWeightedRandom(t *testing.T) {
  function TestDispatchingStrategyFirst (line 148) | func TestDispatchingStrategyFirst(t *testing.T) {
  function TestDispatchingStrategyLeast (line 164) | func TestDispatchingStrategyLeast(t *testing.T) {
  function TestDispatchingStrategyMost (line 184) | func TestDispatchingStrategyMost(t *testing.T) {
  function TestSliceToChannel (line 204) | func TestSliceToChannel(t *testing.T) {
  function TestChannelToSlice (line 225) | func TestChannelToSlice(t *testing.T) {
  function TestGenerate (line 236) | func TestGenerate(t *testing.T) {
  function TestBuffer (line 258) | func TestBuffer(t *testing.T) {
  function TestBufferWithContext (line 280) | func TestBufferWithContext(t *testing.T) { //nolint:paralleltest
  function TestBufferWithTimeout (line 316) | func TestBufferWithTimeout(t *testing.T) { //nolint:paralleltest
  function TestFanIn (line 368) | func TestFanIn(t *testing.T) { //nolint:paralleltest
  function TestFanOut (line 408) | func TestFanOut(t *testing.T) { //nolint:paralleltest

FILE: concurrency.go
  type synchronize (line 9) | type synchronize struct
    method Do (line 13) | func (s *synchronize) Do(callback func()) {
  function Synchronize (line 21) | func Synchronize(opt ...sync.Locker) *synchronize { //nolint:revive
  function Async (line 35) | func Async[A any](f func() A) <-chan A {
  function Async0 (line 45) | func Async0(f func()) <-chan struct{} {
  function Async1 (line 56) | func Async1[A any](f func() A) <-chan A {
  function Async2 (line 62) | func Async2[A, B any](f func() (A, B)) <-chan Tuple2[A, B] {
  function Async3 (line 72) | func Async3[A, B, C any](f func() (A, B, C)) <-chan Tuple3[A, B, C] {
  function Async4 (line 82) | func Async4[A, B, C, D any](f func() (A, B, C, D)) <-chan Tuple4[A, B, C...
  function Async5 (line 92) | func Async5[A, B, C, D, E any](f func() (A, B, C, D, E)) <-chan Tuple5[A...
  function Async6 (line 102) | func Async6[A, B, C, D, E, F any](f func() (A, B, C, D, E, F)) <-chan Tu...
  function WaitFor (line 112) | func WaitFor(condition func(i int) bool, timeout, heartbeatDelay time.Du...
  function WaitForWithContext (line 121) | func WaitForWithContext(ctx context.Context, condition func(ctx context....

FILE: concurrency_test.go
  function TestSynchronize (line 12) | func TestSynchronize(t *testing.T) { //nolint:paralleltest
  function TestAsync (line 63) | func TestAsync(t *testing.T) { //nolint:paralleltest
  function TestAsyncX (line 85) | func TestAsyncX(t *testing.T) { //nolint:paralleltest
  function TestWaitFor (line 215) | func TestWaitFor(t *testing.T) { //nolint:paralleltest
  function TestWaitForWithContext (line 281) | func TestWaitForWithContext(t *testing.T) { //nolint:paralleltest

FILE: condition.go
  function Ternary (line 6) | func Ternary[T any](condition bool, ifOutput, elseOutput T) T {
  function TernaryF (line 16) | func TernaryF[T any](condition bool, ifFunc, elseFunc func() T) T {
  type ifElse (line 26) | type ifElse struct
  function If (line 33) | func If[T any](condition bool, result T) ifElse[T] { //nolint:revive
  function IfF (line 44) | func IfF[T any](condition bool, resultF func() T) ifElse[T] { //nolint:r...
  method ElseIf (line 55) | func (i ifElse[T]) ElseIf(condition bool, result T) ifElse[T] {
  method ElseIfF (line 66) | func (i ifElse[T]) ElseIfF(condition bool, resultF func() T) ifElse[T] {
  method Else (line 77) | func (i ifElse[T]) Else(result T) T {
  method ElseF (line 87) | func (i ifElse[T]) ElseF(resultF func() T) T {
  type switchCase (line 97) | type switchCase struct
  function Switch (line 105) | func Switch[T comparable, R any](predicate T) switchCase[T, R] { //nolin...
  method Case (line 117) | func (s switchCase[T, R]) Case(val T, result R) switchCase[T, R] {
  method CaseF (line 128) | func (s switchCase[T, R]) CaseF(val T, callback func() R) switchCase[T, ...
  method Default (line 139) | func (s switchCase[T, R]) Default(result R) R {
  method DefaultF (line 149) | func (s switchCase[T, R]) DefaultF(callback func() R) R {

FILE: condition_test.go
  function TestTernary (line 9) | func TestTernary(t *testing.T) {
  function TestTernaryF (line 20) | func TestTernaryF(t *testing.T) {
  function TestIfElse (line 31) | func TestIfElse(t *testing.T) {
  function TestIfFElseF (line 46) | func TestIfFElseF(t *testing.T) {
  function TestSwitchCase (line 61) | func TestSwitchCase(t *testing.T) {
  function TestSwitchCaseF (line 76) | func TestSwitchCaseF(t *testing.T) {

FILE: constraints.go
  type Clonable (line 4) | type Clonable interface

FILE: docs/plugins/helpers-pages/components/HelperCard.tsx
  type HelperCardProps (line 9) | interface HelperCardProps {
  function HelperCard (line 13) | function HelperCard({
  type SimilarHelpersProps (line 191) | type SimilarHelpersProps = {
  function SimilarHelpers (line 199) | function SimilarHelpers({

FILE: docs/plugins/helpers-pages/components/HelperList.tsx
  type HelperListProps (line 8) | interface HelperListProps {
  function HelperList (line 13) | function HelperList({

FILE: docs/plugins/helpers-pages/components/HelperTOC.tsx
  type HelperTOCProps (line 6) | interface HelperTOCProps {
  function HelperTOC (line 12) | function HelperTOC({

FILE: docs/plugins/helpers-pages/components/highlightPrototypeGenerics.ts
  function getGenericTypeNamesFromText (line 1) | function getGenericTypeNamesFromText(text: string): string[] {
  function highlightPrototypeGenerics (line 25) | function highlightPrototypeGenerics(container: HTMLElement | null): bool...
  function ensurePrototypeGenericsHighlighted (line 60) | function ensurePrototypeGenericsHighlighted(container: HTMLElement | nul...

FILE: docs/plugins/helpers-pages/index.ts
  type HelperFrontMatter (line 6) | type HelperFrontMatter = {
  type HelperDefinition (line 33) | type HelperDefinition = HelperFrontMatter & {
  function readAllHelperMarkdownFiles (line 38) | function readAllHelperMarkdownFiles(dataDir: string): HelperDefinition[] {
  function pluginHelpersPages (line 78) | function pluginHelpersPages(context: LoadContext): Plugin<void> {

FILE: docs/scripts/check-function-signatures.js
  function readFile (line 11) | function readFile(filePath) {
  function buildFunctionRegex (line 34) | function buildFunctionRegex(name) {
  function findFunctionDeclarations (line 40) | async function findFunctionDeclarations(name, preferredPathHint) {
  function stripBOM (line 60) | function stripBOM(s) {
  function scanFileForSignature (line 64) | async function scanFileForSignature(absPath, fnRegex) {
  function parseSourceRefFile (line 93) | function parseSourceRefFile(sourceRef) {
  function normalizeSignature (line 100) | function normalizeSignature(signature) {
  function main (line 108) | async function main() {

FILE: docs/scripts/utils.js
  function readFile (line 4) | function readFile(filePath) {
  function listMarkdownFiles (line 8) | function listMarkdownFiles(dirPath) {
  function parseFrontmatter (line 15) | function parseFrontmatter(content) {
  function loadHelpers (line 52) | function loadHelpers(dataDir) {
  function expectedFileName (line 93) | function expectedFileName(helper) {
  function toFullKey (line 98) | function toFullKey(ref) {

FILE: docs/src/pages/community.tsx
  function Community (line 10) | function Community() {

FILE: docs/src/pages/index.tsx
  type FeatureItem (line 9) | type FeatureItem = {
  function Feature (line 45) | function Feature({title, Svg, description}: FeatureItem) {
  function HomepageFeatures (line 59) | function HomepageFeatures(): ReactNode {
  function HomepageHeader (line 73) | function HomepageHeader() {
  function Home (line 101) | function Home(): JSX.Element {

FILE: docs/src/prism-include-languages.js
  function prismIncludeLanguages (line 2) | function prismIncludeLanguages(PrismObject) {

FILE: docs/src/theme/DocSidebar/index.tsx
  type Sponsor (line 7) | type Sponsor = {
  function DocSidebarWrapper (line 15) | function DocSidebarWrapper(props: DocSidebarProps) {

FILE: docs/src/theme/NotFound/index.tsx
  function NotFoundPage (line 6) | function NotFoundPage(): JSX.Element {

FILE: docs/src/theme/prism-include-languages.js
  function prismIncludeLanguages (line 2) | function prismIncludeLanguages(PrismObject) {

FILE: errors.go
  constant defaultAssertionFailureMessage (line 9) | defaultAssertionFailureMessage = "assertion failed"
  function Validate (line 13) | func Validate(ok bool, format string, args ...any) error {
  function messageFromMsgAndArgs (line 20) | func messageFromMsgAndArgs(msgAndArgs ...any) string {
  function Must (line 65) | func Must[T any](val T, err any, messageArgs ...any) T {
  function Must0 (line 72) | func Must0(err any, messageArgs ...any) {
  function Must1 (line 78) | func Must1[T any](val T, err any, messageArgs ...any) T {
  function Must2 (line 84) | func Must2[T1, T2 any](val1 T1, val2 T2, err any, messageArgs ...any) (T...
  function Must3 (line 91) | func Must3[T1, T2, T3 any](val1 T1, val2 T2, val3 T3, err any, messageAr...
  function Must4 (line 98) | func Must4[T1, T2, T3, T4 any](val1 T1, val2 T2, val3 T3, val4 T4, err a...
  function Must5 (line 105) | func Must5[T1, T2, T3, T4, T5 any](val1 T1, val2 T2, val3 T3, val4 T4, v...
  function Must6 (line 112) | func Must6[T1, T2, T3, T4, T5, T6 any](val1 T1, val2 T2, val3 T3, val4 T...
  function Try (line 118) | func Try(callback func() error) (ok bool) {
  function Try0 (line 137) | func Try0(callback func()) bool {
  function Try1 (line 146) | func Try1(callback func() error) bool {
  function Try2 (line 152) | func Try2[T any](callback func() (T, error)) bool {
  function Try3 (line 161) | func Try3[T, R any](callback func() (T, R, error)) bool {
  function Try4 (line 170) | func Try4[T, R, S any](callback func() (T, R, S, error)) bool {
  function Try5 (line 179) | func Try5[T, R, S, Q any](callback func() (T, R, S, Q, error)) bool {
  function Try6 (line 188) | func Try6[T, R, S, Q, U any](callback func() (T, R, S, Q, U, error)) bool {
  function TryOr (line 197) | func TryOr[A any](callback func() (A, error), fallbackA A) (A, bool) {
  function TryOr1 (line 203) | func TryOr1[A any](callback func() (A, error), fallbackA A) (A, bool) {
  function TryOr2 (line 219) | func TryOr2[A, B any](callback func() (A, B, error), fallbackA A, fallba...
  function TryOr3 (line 236) | func TryOr3[A, B, C any](callback func() (A, B, C, error), fallbackA A, ...
  function TryOr4 (line 254) | func TryOr4[A, B, C, D any](callback func() (A, B, C, D, error), fallbac...
  function TryOr5 (line 273) | func TryOr5[A, B, C, D, E any](callback func() (A, B, C, D, E, error), f...
  function TryOr6 (line 293) | func TryOr6[A, B, C, D, E, F any](callback func() (A, B, C, D, E, F, err...
  function TryWithErrorValue (line 314) | func TryWithErrorValue(callback func() error) (errorValue any, ok bool) {
  function TryCatch (line 335) | func TryCatch(callback func() error, catch func()) {
  function TryCatchWithErrorValue (line 343) | func TryCatchWithErrorValue(callback func() error, catch func(any)) {
  function ErrorsAs (line 351) | func ErrorsAs[T error](err error) (T, bool) {

FILE: errors_test.go
  function TestValidate (line 16) | func TestValidate(t *testing.T) {
  function TestMust (line 30) | func TestMust(t *testing.T) { //nolint:paralleltest
  function TestMustX (line 71) | func TestMustX(t *testing.T) { //nolint:paralleltest
  function mustCheckerWithStack (line 262) | func mustCheckerWithStack(err any, messageArgs ...any) {
  function errorsJoin (line 296) | func errorsJoin(es ...error) joinErrors { return joinErrors(es) }
  type joinErrors (line 298) | type joinErrors
    method Is (line 300) | func (es joinErrors) Is(target error) bool {
    method Error (line 309) | func (es joinErrors) Error() string {
    method As (line 318) | func (es joinErrors) As(t any) bool {
  function TestMustUserCustomHandler (line 327) | func TestMustUserCustomHandler(t *testing.T) { //nolint:paralleltest
  function TestTry (line 367) | func TestTry(t *testing.T) {
  function TestTryX (line 382) | func TestTryX(t *testing.T) {
  function TestTryOr (line 459) | func TestTryOr(t *testing.T) {
  function TestTryOrX (line 477) | func TestTryOrX(t *testing.T) {
  function TestTryWithErrorValue (line 617) | func TestTryWithErrorValue(t *testing.T) {
  function TestTryCatch (line 643) | func TestTryCatch(t *testing.T) {
  function TestTryCatchWithErrorValue (line 666) | func TestTryCatchWithErrorValue(t *testing.T) {
  type internalError (line 689) | type internalError struct
    method Error (line 693) | func (e *internalError) Error() string {
  function TestErrorsAs (line 697) | func TestErrorsAs(t *testing.T) {
  function TestAssert (line 714) | func TestAssert(t *testing.T) { //nolint:paralleltest
  function TestAssertf (line 746) | func TestAssertf(t *testing.T) { //nolint:paralleltest
  function TestAssertfWithCustom (line 775) | func TestAssertfWithCustom(t *testing.T) { //nolint:paralleltest

FILE: exp/simd/cpu_amd64.go
  constant simdLanes2 (line 8) | simdLanes2  = uint(2)
  constant simdLanes4 (line 9) | simdLanes4  = uint(4)
  constant simdLanes8 (line 10) | simdLanes8  = uint(8)
  constant simdLanes16 (line 11) | simdLanes16 = uint(16)
  constant simdLanes32 (line 12) | simdLanes32 = uint(32)
  constant simdLanes64 (line 13) | simdLanes64 = uint(64)
  type simdFeature (line 17) | type simdFeature
  constant simdFeatureNone (line 20) | simdFeatureNone simdFeature = iota
  constant simdFeatureAVX (line 21) | simdFeatureAVX
  constant simdFeatureAVX2 (line 22) | simdFeatureAVX2
  constant simdFeatureAVX512 (line 23) | simdFeatureAVX512
  function init (line 29) | func init() {

FILE: exp/simd/cpu_amd64_test.go
  type skipHelper (line 15) | type skipHelper interface
  function requireAVX (line 35) | func requireAVX(t skipHelper) {
  function requireAVX2 (line 44) | func requireAVX2(t skipHelper) {
  function requireAVX512 (line 53) | func requireAVX512(t skipHelper) {
  function PrintCPUFeatures (line 62) | func PrintCPUFeatures(t *testing.T) {

FILE: exp/simd/intersect_avx512.go
  function ContainsInt8x16 (line 10) | func ContainsInt8x16[T ~int8](collection []T, target T) bool {
  function ContainsInt16x8 (line 44) | func ContainsInt16x8[T ~int16](collection []T, target T) bool {
  function ContainsInt32x4 (line 76) | func ContainsInt32x4[T ~int32](collection []T, target T) bool {
  function ContainsInt64x2 (line 108) | func ContainsInt64x2[T ~int64](collection []T, target T) bool {
  function ContainsUint8x16 (line 140) | func ContainsUint8x16[T ~uint8](collection []T, target T) bool {
  function ContainsUint16x8 (line 172) | func ContainsUint16x8[T ~uint16](collection []T, target T) bool {
  function ContainsUint32x4 (line 204) | func ContainsUint32x4[T ~uint32](collection []T, target T) bool {
  function ContainsUint64x2 (line 236) | func ContainsUint64x2[T ~uint64](collection []T, target T) bool {
  function ContainsFloat32x4 (line 268) | func ContainsFloat32x4[T ~float32](collection []T, target T) bool {
  function ContainsFloat64x2 (line 300) | func ContainsFloat64x2[T ~float64](collection []T, target T) bool {
  function ContainsInt8x32 (line 332) | func ContainsInt8x32[T ~int8](collection []T, target T) bool {
  function ContainsInt16x16 (line 364) | func ContainsInt16x16[T ~int16](collection []T, target T) bool {
  function ContainsInt32x8 (line 396) | func ContainsInt32x8[T ~int32](collection []T, target T) bool {
  function ContainsInt64x4 (line 428) | func ContainsInt64x4[T ~int64](collection []T, target T) bool {
  function ContainsUint8x32 (line 460) | func ContainsUint8x32[T ~uint8](collection []T, target T) bool {
  function ContainsUint16x16 (line 492) | func ContainsUint16x16[T ~uint16](collection []T, target T) bool {
  function ContainsUint32x8 (line 524) | func ContainsUint32x8[T ~uint32](collection []T, target T) bool {
  function ContainsUint64x4 (line 556) | func ContainsUint64x4[T ~uint64](collection []T, target T) bool {
  function ContainsFloat32x8 (line 588) | func ContainsFloat32x8[T ~float32](collection []T, target T) bool {
  function ContainsFloat64x4 (line 620) | func ContainsFloat64x4[T ~float64](collection []T, target T) bool {
  function ContainsInt8x64 (line 652) | func ContainsInt8x64[T ~int8](collection []T, target T) bool {
  function ContainsInt16x32 (line 684) | func ContainsInt16x32[T ~int16](collection []T, target T) bool {
  function ContainsInt32x16 (line 716) | func ContainsInt32x16[T ~int32](collection []T, target T) bool {
  function ContainsInt64x8 (line 748) | func ContainsInt64x8[T ~int64](collection []T, target T) bool {
  function ContainsUint8x64 (line 780) | func ContainsUint8x64[T ~uint8](collection []T, target T) bool {
  function ContainsUint16x32 (line 812) | func ContainsUint16x32[T ~uint16](collection []T, target T) bool {
  function ContainsUint32x16 (line 844) | func ContainsUint32x16[T ~uint32](collection []T, target T) bool {
  function ContainsUint64x8 (line 876) | func ContainsUint64x8[T ~uint64](collection []T, target T) bool {
  function ContainsFloat32x16 (line 908) | func ContainsFloat32x16[T ~float32](collection []T, target T) bool {
  function ContainsFloat64x8 (line 940) | func ContainsFloat64x8[T ~float64](collection []T, target T) bool {

FILE: exp/simd/intersect_avx512_test.go
  function TestAVX512ContainsInt8x16 (line 12) | func TestAVX512ContainsInt8x16(t *testing.T) {
  function TestAVX512ContainsInt16x8 (line 62) | func TestAVX512ContainsInt16x8(t *testing.T) {
  function TestAVX512ContainsInt32x4 (line 108) | func TestAVX512ContainsInt32x4(t *testing.T) {
  function TestAVX512ContainsInt64x2 (line 152) | func TestAVX512ContainsInt64x2(t *testing.T) {
  function TestAVX512ContainsUint8x16 (line 196) | func TestAVX512ContainsUint8x16(t *testing.T) {
  function TestAVX512ContainsUint16x8 (line 244) | func TestAVX512ContainsUint16x8(t *testing.T) {
  function TestAVX512ContainsUint32x4 (line 288) | func TestAVX512ContainsUint32x4(t *testing.T) {
  function TestAVX512ContainsUint64x2 (line 331) | func TestAVX512ContainsUint64x2(t *testing.T) {
  function TestAVX512ContainsFloat32x4 (line 374) | func TestAVX512ContainsFloat32x4(t *testing.T) {
  function TestAVX512ContainsFloat64x2 (line 416) | func TestAVX512ContainsFloat64x2(t *testing.T) {
  function TestAVX512ContainsInt8x32 (line 457) | func TestAVX512ContainsInt8x32(t *testing.T) {
  function TestAVX512ContainsInt16x16 (line 503) | func TestAVX512ContainsInt16x16(t *testing.T) {
  function TestAVX512ContainsInt32x8 (line 549) | func TestAVX512ContainsInt32x8(t *testing.T) {
  function TestAVX512ContainsInt64x4 (line 593) | func TestAVX512ContainsInt64x4(t *testing.T) {
  function TestAVX512ContainsUint8x32 (line 637) | func TestAVX512ContainsUint8x32(t *testing.T) {
  function TestAVX512ContainsUint16x16 (line 685) | func TestAVX512ContainsUint16x16(t *testing.T) {
  function TestAVX512ContainsUint32x8 (line 732) | func TestAVX512ContainsUint32x8(t *testing.T) {
  function TestAVX512ContainsUint64x4 (line 775) | func TestAVX512ContainsUint64x4(t *testing.T) {
  function TestAVX512ContainsFloat32x8 (line 818) | func TestAVX512ContainsFloat32x8(t *testing.T) {
  function TestAVX512ContainsFloat64x4 (line 860) | func TestAVX512ContainsFloat64x4(t *testing.T) {
  function TestAVX512ContainsConsistency (line 902) | func TestAVX512ContainsConsistency(t *testing.T) {
  function TestAVX512ContainsInt8x64 (line 1209) | func TestAVX512ContainsInt8x64(t *testing.T) {
  function TestAVX512ContainsInt16x32 (line 1255) | func TestAVX512ContainsInt16x32(t *testing.T) {
  function TestAVX512ContainsInt32x16 (line 1301) | func TestAVX512ContainsInt32x16(t *testing.T) {
  function TestAVX512ContainsInt64x8 (line 1345) | func TestAVX512ContainsInt64x8(t *testing.T) {
  function TestAVX512ContainsUint8x64 (line 1389) | func TestAVX512ContainsUint8x64(t *testing.T) {
  function TestAVX512ContainsUint16x32 (line 1437) | func TestAVX512ContainsUint16x32(t *testing.T) {
  function TestAVX512ContainsUint32x16 (line 1484) | func TestAVX512ContainsUint32x16(t *testing.T) {
  function TestAVX512ContainsUint64x8 (line 1527) | func TestAVX512ContainsUint64x8(t *testing.T) {
  function TestAVX512ContainsFloat32x16 (line 1570) | func TestAVX512ContainsFloat32x16(t *testing.T) {
  function TestAVX512ContainsFloat64x8 (line 1612) | func TestAVX512ContainsFloat64x8(t *testing.T) {
  function TestAVX512ContainsTypeAlias (line 1654) | func TestAVX512ContainsTypeAlias(t *testing.T) {

FILE: exp/simd/intersect_bench_test.go
  function BenchmarkContainsInt8 (line 30) | func BenchmarkContainsInt8(b *testing.B) {
  function BenchmarkContainsInt16 (line 65) | func BenchmarkContainsInt16(b *testing.B) {
  function BenchmarkContainsInt32 (line 100) | func BenchmarkContainsInt32(b *testing.B) {
  function BenchmarkContainsInt64 (line 135) | func BenchmarkContainsInt64(b *testing.B) {
  function BenchmarkContainsUint8 (line 170) | func BenchmarkContainsUint8(b *testing.B) {
  function BenchmarkContainsUint16 (line 205) | func BenchmarkContainsUint16(b *testing.B) {
  function BenchmarkContainsUint32 (line 240) | func BenchmarkContainsUint32(b *testing.B) {
  function BenchmarkContainsUint64 (line 275) | func BenchmarkContainsUint64(b *testing.B) {
  function BenchmarkContainsFloat32 (line 310) | func BenchmarkContainsFloat32(b *testing.B) {
  function BenchmarkContainsFloat64 (line 345) | func BenchmarkContainsFloat64(b *testing.B) {
  function BenchmarkContainsWorstCase (line 381) | func BenchmarkContainsWorstCase(b *testing.B) {
  function BenchmarkContainsBestCase (line 417) | func BenchmarkContainsBestCase(b *testing.B) {
  function BenchmarkContainsNegative (line 453) | func BenchmarkContainsNegative(b *testing.B) {
  function BenchmarkContainsInt8ByWidth (line 489) | func BenchmarkContainsInt8ByWidth(b *testing.B) {
  function BenchmarkContainsInt64SteadyState (line 520) | func BenchmarkContainsInt64SteadyState(b *testing.B) {

FILE: exp/simd/math.go
  function SumInt8 (line 13) | func SumInt8[T ~int8](collection []T) T {
  function SumInt16 (line 30) | func SumInt16[T ~int16](collection []T) T {
  function SumInt32 (line 47) | func SumInt32[T ~int32](collection []T) T {
  function SumInt64 (line 64) | func SumInt64[T ~int64](collection []T) T {
  function SumUint8 (line 81) | func SumUint8[T ~uint8](collection []T) T {
  function SumUint16 (line 98) | func SumUint16[T ~uint16](collection []T) T {
  function SumUint32 (line 115) | func SumUint32[T ~uint32](collection []T) T {
  function SumUint64 (line 132) | func SumUint64[T ~uint64](collection []T) T {
  function SumFloat32 (line 148) | func SumFloat32[T ~float32](collection []T) T {
  function SumFloat64 (line 164) | func SumFloat64[T ~float64](collection []T) T {
  function MeanInt8 (line 178) | func MeanInt8[T ~int8](collection []T) T {
  function MeanInt16 (line 192) | func MeanInt16[T ~int16](collection []T) T {
  function MeanInt32 (line 206) | func MeanInt32[T ~int32](collection []T) T {
  function MeanInt64 (line 220) | func MeanInt64[T ~int64](collection []T) T {
  function MeanUint8 (line 234) | func MeanUint8[T ~uint8](collection []T) T {
  function MeanUint16 (line 248) | func MeanUint16[T ~uint16](collection []T) T {
  function MeanUint32 (line 262) | func MeanUint32[T ~uint32](collection []T) T {
  function MeanUint64 (line 276) | func MeanUint64[T ~uint64](collection []T) T {
  function MeanFloat32 (line 290) | func MeanFloat32[T ~float32](collection []T) T {
  function MeanFloat64 (line 304) | func MeanFloat64[T ~float64](collection []T) T {
  function MinInt8 (line 318) | func MinInt8[T ~int8](collection []T) T {
  function MinInt16 (line 332) | func MinInt16[T ~int16](collection []T) T {
  function MinInt32 (line 346) | func MinInt32[T ~int32](collection []T) T {
  function MinInt64 (line 360) | func MinInt64[T ~int64](collection []T) T {
  function MinUint8 (line 375) | func MinUint8[T ~uint8](collection []T) T {
  function MinUint16 (line 389) | func MinUint16[T ~uint16](collection []T) T {
  function MinUint32 (line 403) | func MinUint32[T ~uint32](collection []T) T {
  function MinUint64 (line 417) | func MinUint64[T ~uint64](collection []T) T {
  function MinFloat32 (line 432) | func MinFloat32[T ~float32](collection []T) T {
  function MinFloat64 (line 446) | func MinFloat64[T ~float64](collection []T) T {
  function MaxInt8 (line 460) | func MaxInt8[T ~int8](collection []T) T {
  function MaxInt16 (line 474) | func MaxInt16[T ~int16](collection []T) T {
  function MaxInt32 (line 488) | func MaxInt32[T ~int32](collection []T) T {
  function MaxInt64 (line 502) | func MaxInt64[T ~int64](collection []T) T {
  function MaxUint8 (line 517) | func MaxUint8[T ~uint8](collection []T) T {
  function MaxUint16 (line 531) | func MaxUint16[T ~uint16](collection []T) T {
  function MaxUint32 (line 545) | func MaxUint32[T ~uint32](collection []T) T {
  function MaxUint64 (line 559) | func MaxUint64[T ~uint64](collection []T) T {
  function MaxFloat32 (line 574) | func MaxFloat32[T ~float32](collection []T) T {
  function MaxFloat64 (line 588) | func MaxFloat64[T ~float64](collection []T) T {
  function ClampInt8 (line 602) | func ClampInt8[T ~int8, Slice ~[]T](collection Slice, min, max T) Slice {
  function ClampInt16 (line 626) | func ClampInt16[T ~int16, Slice ~[]T](collection Slice, min, max T) Slice {
  function ClampInt32 (line 650) | func ClampInt32[T ~int32, Slice ~[]T](collection Slice, min, max T) Slice {
  function ClampInt64 (line 674) | func ClampInt64[T ~int64, Slice ~[]T](collection Slice, min, max T) Slice {
  function ClampUint8 (line 699) | func ClampUint8[T ~uint8, Slice ~[]T](collection Slice, min, max T) Slice {
  function ClampUint16 (line 723) | func ClampUint16[T ~uint16, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampUint32 (line 747) | func ClampUint32[T ~uint32, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampUint64 (line 771) | func ClampUint64[T ~uint64, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampFloat32 (line 796) | func ClampFloat32[T ~float32, Slice ~[]T](collection Slice, min, max T) ...
  function ClampFloat64 (line 820) | func ClampFloat64[T ~float64, Slice ~[]T](collection Slice, min, max T) ...
  function SumByInt8 (line 848) | func SumByInt8[T any, R ~int8](collection []T, iteratee func(item T) R) R {
  function SumByInt16 (line 866) | func SumByInt16[T any, R ~int16](collection []T, iteratee func(item T) R...
  function SumByInt32 (line 884) | func SumByInt32[T any, R ~int32](collection []T, iteratee func(item T) R...
  function SumByInt64 (line 902) | func SumByInt64[T any, R ~int64](collection []T, iteratee func(item T) R...
  function SumByUint8 (line 920) | func SumByUint8[T any, R ~uint8](collection []T, iteratee func(item T) R...
  function SumByUint16 (line 938) | func SumByUint16[T any, R ~uint16](collection []T, iteratee func(item T)...
  function SumByUint32 (line 956) | func SumByUint32[T any, R ~uint32](collection []T, iteratee func(item T)...
  function SumByUint64 (line 974) | func SumByUint64[T any, R ~uint64](collection []T, iteratee func(item T)...
  function SumByFloat32 (line 991) | func SumByFloat32[T any, R ~float32](collection []T, iteratee func(item ...
  function SumByFloat64 (line 1008) | func SumByFloat64[T any, R ~float64](collection []T, iteratee func(item ...
  function MeanByInt8 (line 1023) | func MeanByInt8[T any, R ~int8](collection []T, iteratee func(item T) R)...
  function MeanByInt16 (line 1038) | func MeanByInt16[T any, R ~int16](collection []T, iteratee func(item T) ...
  function MeanByInt32 (line 1053) | func MeanByInt32[T any, R ~int32](collection []T, iteratee func(item T) ...
  function MeanByInt64 (line 1068) | func MeanByInt64[T any, R ~int64](collection []T, iteratee func(item T) ...
  function MeanByUint8 (line 1083) | func MeanByUint8[T any, R ~uint8](collection []T, iteratee func(item T) ...
  function MeanByUint16 (line 1098) | func MeanByUint16[T any, R ~uint16](collection []T, iteratee func(item T...
  function MeanByUint32 (line 1113) | func MeanByUint32[T any, R ~uint32](collection []T, iteratee func(item T...
  function MeanByUint64 (line 1128) | func MeanByUint64[T any, R ~uint64](collection []T, iteratee func(item T...
  function MeanByFloat32 (line 1143) | func MeanByFloat32[T any, R ~float32](collection []T, iteratee func(item...
  function MeanByFloat64 (line 1158) | func MeanByFloat64[T any, R ~float64](collection []T, iteratee func(item...

FILE: exp/simd/math_avx.go
  function SumInt8x16 (line 18) | func SumInt8x16[T ~int8](collection []T) T {
  function SumInt16x8 (line 52) | func SumInt16x8[T ~int16](collection []T) T {
  function SumInt32x4 (line 86) | func SumInt32x4[T ~int32](collection []T) T {
  function SumInt64x2 (line 120) | func SumInt64x2[T ~int64](collection []T) T {
  function SumUint8x16 (line 154) | func SumUint8x16[T ~uint8](collection []T) T {
  function SumUint16x8 (line 188) | func SumUint16x8[T ~uint16](collection []T) T {
  function SumUint32x4 (line 222) | func SumUint32x4[T ~uint32](collection []T) T {
  function SumUint64x2 (line 256) | func SumUint64x2[T ~uint64](collection []T) T {
  function SumFloat32x4 (line 289) | func SumFloat32x4[T ~float32](collection []T) T {
  function SumFloat64x2 (line 322) | func SumFloat64x2[T ~float64](collection []T) T {
  function MeanInt8x16 (line 353) | func MeanInt8x16[T ~int8](collection []T) T {
  function MeanInt16x8 (line 363) | func MeanInt16x8[T ~int16](collection []T) T {
  function MeanInt32x4 (line 373) | func MeanInt32x4[T ~int32](collection []T) T {
  function MeanInt64x2 (line 383) | func MeanInt64x2[T ~int64](collection []T) T {
  function MeanUint8x16 (line 393) | func MeanUint8x16[T ~uint8](collection []T) T {
  function MeanUint16x8 (line 403) | func MeanUint16x8[T ~uint16](collection []T) T {
  function MeanUint32x4 (line 413) | func MeanUint32x4[T ~uint32](collection []T) T {
  function MeanUint64x2 (line 423) | func MeanUint64x2[T ~uint64](collection []T) T {
  function MeanFloat32x4 (line 433) | func MeanFloat32x4[T ~float32](collection []T) T {
  function MeanFloat64x2 (line 444) | func MeanFloat64x2[T ~float64](collection []T) T {
  function ClampInt8x16 (line 454) | func ClampInt8x16[T ~int8, Slice ~[]T](collection Slice, min, max T) Sli...
  function ClampInt16x8 (line 492) | func ClampInt16x8[T ~int16, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampInt32x4 (line 530) | func ClampInt32x4[T ~int32, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampUint8x16 (line 568) | func ClampUint8x16[T ~uint8, Slice ~[]T](collection Slice, min, max T) S...
  function ClampUint16x8 (line 606) | func ClampUint16x8[T ~uint16, Slice ~[]T](collection Slice, min, max T) ...
  function ClampUint32x4 (line 644) | func ClampUint32x4[T ~uint32, Slice ~[]T](collection Slice, min, max T) ...
  function ClampFloat32x4 (line 682) | func ClampFloat32x4[T ~float32, Slice ~[]T](collection Slice, min, max T...
  function ClampFloat64x2 (line 720) | func ClampFloat64x2[T ~float64, Slice ~[]T](collection Slice, min, max T...
  function MinInt8x16 (line 758) | func MinInt8x16[T ~int8](collection []T) T {
  function MinInt16x8 (line 805) | func MinInt16x8[T ~int16](collection []T) T {
  function MinInt32x4 (line 849) | func MinInt32x4[T ~int32](collection []T) T {
  function MinUint8x16 (line 893) | func MinUint8x16[T ~uint8](collection []T) T {
  function MinUint16x8 (line 940) | func MinUint16x8[T ~uint16](collection []T) T {
  function MinUint32x4 (line 984) | func MinUint32x4[T ~uint32](collection []T) T {
  function MinFloat32x4 (line 1028) | func MinFloat32x4[T ~float32](collection []T) T {
  function MinFloat64x2 (line 1072) | func MinFloat64x2[T ~float64](collection []T) T {
  function MaxInt8x16 (line 1116) | func MaxInt8x16[T ~int8](collection []T) T {
  function MaxInt16x8 (line 1163) | func MaxInt16x8[T ~int16](collection []T) T {
  function MaxInt32x4 (line 1207) | func MaxInt32x4[T ~int32](collection []T) T {
  function MaxUint8x16 (line 1251) | func MaxUint8x16[T ~uint8](collection []T) T {
  function MaxUint16x8 (line 1298) | func MaxUint16x8[T ~uint16](collection []T) T {
  function MaxUint32x4 (line 1342) | func MaxUint32x4[T ~uint32](collection []T) T {
  function MaxFloat32x4 (line 1386) | func MaxFloat32x4[T ~float32](collection []T) T {
  function MaxFloat64x2 (line 1430) | func MaxFloat64x2[T ~float64](collection []T) T {
  function SumByInt8x16 (line 1477) | func SumByInt8x16[T any, R ~int8](collection []T, iteratee func(item T) ...
  function SumByInt16x8 (line 1483) | func SumByInt16x8[T any, R ~int16](collection []T, iteratee func(item T)...
  function SumByInt32x4 (line 1489) | func SumByInt32x4[T any, R ~int32](collection []T, iteratee func(item T)...
  function SumByInt64x2 (line 1495) | func SumByInt64x2[T any, R ~int64](collection []T, iteratee func(item T)...
  function SumByUint8x16 (line 1501) | func SumByUint8x16[T any, R ~uint8](collection []T, iteratee func(item T...
  function SumByUint16x8 (line 1507) | func SumByUint16x8[T any, R ~uint16](collection []T, iteratee func(item ...
  function SumByUint32x4 (line 1513) | func SumByUint32x4[T any, R ~uint32](collection []T, iteratee func(item ...
  function SumByUint64x2 (line 1519) | func SumByUint64x2[T any, R ~uint64](collection []T, iteratee func(item ...
  function SumByFloat32x4 (line 1525) | func SumByFloat32x4[T any, R ~float32](collection []T, iteratee func(ite...
  function SumByFloat64x2 (line 1531) | func SumByFloat64x2[T any, R ~float64](collection []T, iteratee func(ite...
  function MeanByInt8x16 (line 1540) | func MeanByInt8x16[T any, R ~int8](collection []T, iteratee func(item T)...
  function MeanByInt16x8 (line 1546) | func MeanByInt16x8[T any, R ~int16](collection []T, iteratee func(item T...
  function MeanByInt32x4 (line 1552) | func MeanByInt32x4[T any, R ~int32](collection []T, iteratee func(item T...
  function MeanByInt64x2 (line 1558) | func MeanByInt64x2[T any, R ~int64](collection []T, iteratee func(item T...
  function MeanByUint8x16 (line 1564) | func MeanByUint8x16[T any, R ~uint8](collection []T, iteratee func(item ...
  function MeanByUint16x8 (line 1570) | func MeanByUint16x8[T any, R ~uint16](collection []T, iteratee func(item...
  function MeanByUint32x4 (line 1576) | func MeanByUint32x4[T any, R ~uint32](collection []T, iteratee func(item...
  function MeanByUint64x2 (line 1582) | func MeanByUint64x2[T any, R ~uint64](collection []T, iteratee func(item...
  function MeanByFloat32x4 (line 1588) | func MeanByFloat32x4[T any, R ~float32](collection []T, iteratee func(it...
  function MeanByFloat64x2 (line 1594) | func MeanByFloat64x2[T any, R ~float64](collection []T, iteratee func(it...

FILE: exp/simd/math_avx2.go
  function SumInt8x32 (line 18) | func SumInt8x32[T ~int8](collection []T) T {
  function SumInt16x16 (line 52) | func SumInt16x16[T ~int16](collection []T) T {
  function SumInt32x8 (line 86) | func SumInt32x8[T ~int32](collection []T) T {
  function SumInt64x4 (line 120) | func SumInt64x4[T ~int64](collection []T) T {
  function SumUint8x32 (line 154) | func SumUint8x32[T ~uint8](collection []T) T {
  function SumUint16x16 (line 188) | func SumUint16x16[T ~uint16](collection []T) T {
  function SumUint32x8 (line 222) | func SumUint32x8[T ~uint32](collection []T) T {
  function SumUint64x4 (line 256) | func SumUint64x4[T ~uint64](collection []T) T {
  function SumFloat32x8 (line 289) | func SumFloat32x8[T ~float32](collection []T) T {
  function SumFloat64x4 (line 322) | func SumFloat64x4[T ~float64](collection []T) T {
  function MeanInt8x32 (line 353) | func MeanInt8x32[T ~int8](collection []T) T {
  function MeanInt16x16 (line 362) | func MeanInt16x16[T ~int16](collection []T) T {
  function MeanInt32x8 (line 371) | func MeanInt32x8[T ~int32](collection []T) T {
  function MeanInt64x4 (line 380) | func MeanInt64x4[T ~int64](collection []T) T {
  function MeanUint8x32 (line 389) | func MeanUint8x32[T ~uint8](collection []T) T {
  function MeanUint16x16 (line 398) | func MeanUint16x16[T ~uint16](collection []T) T {
  function MeanUint32x8 (line 407) | func MeanUint32x8[T ~uint32](collection []T) T {
  function MeanUint64x4 (line 416) | func MeanUint64x4[T ~uint64](collection []T) T {
  function MeanFloat32x8 (line 425) | func MeanFloat32x8[T ~float32](collection []T) T {
  function MeanFloat64x4 (line 434) | func MeanFloat64x4[T ~float64](collection []T) T {
  function ClampInt8x32 (line 443) | func ClampInt8x32[T ~int8, Slice ~[]T](collection Slice, min, max T) Sli...
  function ClampInt16x16 (line 480) | func ClampInt16x16[T ~int16, Slice ~[]T](collection Slice, min, max T) S...
  function ClampInt32x8 (line 517) | func ClampInt32x8[T ~int32, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampInt64x4 (line 554) | func ClampInt64x4[T ~int64, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampUint8x32 (line 591) | func ClampUint8x32[T ~uint8, Slice ~[]T](collection Slice, min, max T) S...
  function ClampUint16x16 (line 628) | func ClampUint16x16[T ~uint16, Slice ~[]T](collection Slice, min, max T)...
  function ClampUint32x8 (line 665) | func ClampUint32x8[T ~uint32, Slice ~[]T](collection Slice, min, max T) ...
  function ClampUint64x4 (line 702) | func ClampUint64x4[T ~uint64, Slice ~[]T](collection Slice, min, max T) ...
  function ClampFloat32x8 (line 739) | func ClampFloat32x8[T ~float32, Slice ~[]T](collection Slice, min, max T...
  function ClampFloat64x4 (line 776) | func ClampFloat64x4[T ~float64, Slice ~[]T](collection Slice, min, max T...
  function MinInt8x32 (line 813) | func MinInt8x32[T ~int8](collection []T) T {
  function MinInt16x16 (line 862) | func MinInt16x16[T ~int16](collection []T) T {
  function MinInt32x8 (line 909) | func MinInt32x8[T ~int32](collection []T) T {
  function MinInt64x4 (line 953) | func MinInt64x4[T ~int64](collection []T) T {
  function MinUint8x32 (line 997) | func MinUint8x32[T ~uint8](collection []T) T {
  function MinUint16x16 (line 1046) | func MinUint16x16[T ~uint16](collection []T) T {
  function MinUint32x8 (line 1093) | func MinUint32x8[T ~uint32](collection []T) T {
  function MinUint64x4 (line 1137) | func MinUint64x4[T ~uint64](collection []T) T {
  function MinFloat32x8 (line 1181) | func MinFloat32x8[T ~float32](collection []T) T {
  function MinFloat64x4 (line 1225) | func MinFloat64x4[T ~float64](collection []T) T {
  function MaxInt8x32 (line 1269) | func MaxInt8x32[T ~int8](collection []T) T {
  function MaxInt16x16 (line 1318) | func MaxInt16x16[T ~int16](collection []T) T {
  function MaxInt32x8 (line 1365) | func MaxInt32x8[T ~int32](collection []T) T {
  function MaxInt64x4 (line 1409) | func MaxInt64x4[T ~int64](collection []T) T {
  function MaxUint8x32 (line 1453) | func MaxUint8x32[T ~uint8](collection []T) T {
  function MaxUint16x16 (line 1502) | func MaxUint16x16[T ~uint16](collection []T) T {
  function MaxUint32x8 (line 1549) | func MaxUint32x8[T ~uint32](collection []T) T {
  function MaxUint64x4 (line 1593) | func MaxUint64x4[T ~uint64](collection []T) T {
  function MaxFloat32x8 (line 1637) | func MaxFloat32x8[T ~float32](collection []T) T {
  function MaxFloat64x4 (line 1681) | func MaxFloat64x4[T ~float64](collection []T) T {
  function SumByInt8x32 (line 1728) | func SumByInt8x32[T any, R ~int8](collection []T, iteratee func(item T) ...
  function SumByInt16x16 (line 1734) | func SumByInt16x16[T any, R ~int16](collection []T, iteratee func(item T...
  function SumByInt32x8 (line 1740) | func SumByInt32x8[T any, R ~int32](collection []T, iteratee func(item T)...
  function SumByInt64x4 (line 1746) | func SumByInt64x4[T any, R ~int64](collection []T, iteratee func(item T)...
  function SumByUint8x32 (line 1752) | func SumByUint8x32[T any, R ~uint8](collection []T, iteratee func(item T...
  function SumByUint16x16 (line 1758) | func SumByUint16x16[T any, R ~uint16](collection []T, iteratee func(item...
  function SumByUint32x8 (line 1764) | func SumByUint32x8[T any, R ~uint32](collection []T, iteratee func(item ...
  function SumByUint64x4 (line 1770) | func SumByUint64x4[T any, R ~uint64](collection []T, iteratee func(item ...
  function SumByFloat32x8 (line 1776) | func SumByFloat32x8[T any, R ~float32](collection []T, iteratee func(ite...
  function SumByFloat64x4 (line 1782) | func SumByFloat64x4[T any, R ~float64](collection []T, iteratee func(ite...
  function MeanByInt8x32 (line 1791) | func MeanByInt8x32[T any, R ~int8](collection []T, iteratee func(item T)...
  function MeanByInt16x16 (line 1797) | func MeanByInt16x16[T any, R ~int16](collection []T, iteratee func(item ...
  function MeanByInt32x8 (line 1803) | func MeanByInt32x8[T any, R ~int32](collection []T, iteratee func(item T...
  function MeanByInt64x4 (line 1809) | func MeanByInt64x4[T any, R ~int64](collection []T, iteratee func(item T...
  function MeanByUint8x32 (line 1815) | func MeanByUint8x32[T any, R ~uint8](collection []T, iteratee func(item ...
  function MeanByUint16x16 (line 1821) | func MeanByUint16x16[T any, R ~uint16](collection []T, iteratee func(ite...
  function MeanByUint32x8 (line 1827) | func MeanByUint32x8[T any, R ~uint32](collection []T, iteratee func(item...
  function MeanByUint64x4 (line 1833) | func MeanByUint64x4[T any, R ~uint64](collection []T, iteratee func(item...
  function MeanByFloat32x8 (line 1839) | func MeanByFloat32x8[T any, R ~float32](collection []T, iteratee func(it...
  function MeanByFloat64x4 (line 1845) | func MeanByFloat64x4[T any, R ~float64](collection []T, iteratee func(it...

FILE: exp/simd/math_avx2_test.go
  function TestSumInt8x32 (line 12) | func TestSumInt8x32(t *testing.T) {
  function TestSumInt16x16 (line 44) | func TestSumInt16x16(t *testing.T) {
  function TestSumInt32x8 (line 76) | func TestSumInt32x8(t *testing.T) {
  function TestSumInt64x4 (line 108) | func TestSumInt64x4(t *testing.T) {
  function TestSumUint8x32 (line 140) | func TestSumUint8x32(t *testing.T) {
  function TestSumUint16x16 (line 171) | func TestSumUint16x16(t *testing.T) {
  function TestSumUint32x8 (line 202) | func TestSumUint32x8(t *testing.T) {
  function TestSumUint64x4 (line 233) | func TestSumUint64x4(t *testing.T) {
  function TestSumFloat32x8 (line 264) | func TestSumFloat32x8(t *testing.T) {
  function TestSumFloat64x4 (line 297) | func TestSumFloat64x4(t *testing.T) {
  function TestAVX2TypeAlias (line 331) | func TestAVX2TypeAlias(t *testing.T) {
  function TestMeanInt8x32 (line 342) | func TestMeanInt8x32(t *testing.T) {
  function TestMeanInt16x16 (line 374) | func TestMeanInt16x16(t *testing.T) {
  function TestMeanInt32x8 (line 406) | func TestMeanInt32x8(t *testing.T) {
  function TestMeanInt64x4 (line 438) | func TestMeanInt64x4(t *testing.T) {
  function TestMeanUint8x32 (line 470) | func TestMeanUint8x32(t *testing.T) {
  function TestMeanUint16x16 (line 501) | func TestMeanUint16x16(t *testing.T) {
  function TestMeanUint32x8 (line 532) | func TestMeanUint32x8(t *testing.T) {
  function TestMeanUint64x4 (line 563) | func TestMeanUint64x4(t *testing.T) {
  function TestMeanFloat32x8 (line 594) | func TestMeanFloat32x8(t *testing.T) {
  function TestMeanFloat64x4 (line 627) | func TestMeanFloat64x4(t *testing.T) {
  function TestAVX2MeanTypeAlias (line 661) | func TestAVX2MeanTypeAlias(t *testing.T) {
  function TestClampInt8x32 (line 672) | func TestClampInt8x32(t *testing.T) {
  function TestClampInt16x16 (line 723) | func TestClampInt16x16(t *testing.T) {
  function TestClampInt32x8 (line 773) | func TestClampInt32x8(t *testing.T) {
  function TestClampInt64x4 (line 822) | func TestClampInt64x4(t *testing.T) {
  function TestClampUint8x32 (line 872) | func TestClampUint8x32(t *testing.T) {
  function TestClampUint16x16 (line 923) | func TestClampUint16x16(t *testing.T) {
  function TestClampUint32x8 (line 973) | func TestClampUint32x8(t *testing.T) {
  function TestClampUint64x4 (line 1022) | func TestClampUint64x4(t *testing.T) {
  function TestClampFloat32x8 (line 1072) | func TestClampFloat32x8(t *testing.T) {
  function TestClampFloat64x4 (line 1124) | func TestClampFloat64x4(t *testing.T) {
  function TestAVX2ClampTypeAlias (line 1177) | func TestAVX2ClampTypeAlias(t *testing.T) {
  function TestMinInt8x32 (line 1201) | func TestMinInt8x32(t *testing.T) {
  function TestMinInt16x16 (line 1233) | func TestMinInt16x16(t *testing.T) {
  function TestMinInt32x8 (line 1265) | func TestMinInt32x8(t *testing.T) {
  function TestMinInt64x4 (line 1297) | func TestMinInt64x4(t *testing.T) {
  function TestMinUint8x32 (line 1330) | func TestMinUint8x32(t *testing.T) {
  function TestMinUint16x16 (line 1362) | func TestMinUint16x16(t *testing.T) {
  function TestMinUint32x8 (line 1394) | func TestMinUint32x8(t *testing.T) {
  function TestMinUint64x4 (line 1425) | func TestMinUint64x4(t *testing.T) {
  function TestMinFloat32x8 (line 1457) | func TestMinFloat32x8(t *testing.T) {
  function TestMinFloat64x4 (line 1491) | func TestMinFloat64x4(t *testing.T) {
  function TestAVX2MinTypeAlias (line 1525) | func TestAVX2MinTypeAlias(t *testing.T) {
  function TestMaxInt8x32 (line 1536) | func TestMaxInt8x32(t *testing.T) {
  function TestMaxInt16x16 (line 1568) | func TestMaxInt16x16(t *testing.T) {
  function TestMaxInt32x8 (line 1600) | func TestMaxInt32x8(t *testing.T) {
  function TestMaxInt64x4 (line 1632) | func TestMaxInt64x4(t *testing.T) {
  function TestMaxUint8x32 (line 1665) | func TestMaxUint8x32(t *testing.T) {
  function TestMaxUint16x16 (line 1697) | func TestMaxUint16x16(t *testing.T) {
  function TestMaxUint32x8 (line 1729) | func TestMaxUint32x8(t *testing.T) {
  function TestMaxUint64x4 (line 1760) | func TestMaxUint64x4(t *testing.T) {
  function TestMaxFloat32x8 (line 1792) | func TestMaxFloat32x8(t *testing.T) {
  function TestMaxFloat64x4 (line 1826) | func TestMaxFloat64x4(t *testing.T) {
  function TestAVX2MaxTypeAlias (line 1860) | func TestAVX2MaxTypeAlias(t *testing.T) {
  type avx2Item (line 1873) | type avx2Item struct
  function TestSumByInt8x32 (line 1879) | func TestSumByInt8x32(t *testing.T) {
  function TestSumByInt16x16 (line 1913) | func TestSumByInt16x16(t *testing.T) {
  function TestSumByInt32x8 (line 1950) | func TestSumByInt32x8(t *testing.T) {
  function TestSumByInt64x4 (line 1987) | func TestSumByInt64x4(t *testing.T) {
  function TestSumByUint8x32 (line 2024) | func TestSumByUint8x32(t *testing.T) {
  function TestSumByUint16x16 (line 2061) | func TestSumByUint16x16(t *testing.T) {
  function TestSumByUint32x8 (line 2098) | func TestSumByUint32x8(t *testing.T) {
  function TestSumByUint64x4 (line 2134) | func TestSumByUint64x4(t *testing.T) {
  function TestSumByFloat32x8 (line 2170) | func TestSumByFloat32x8(t *testing.T) {
  function TestSumByFloat64x4 (line 2209) | func TestSumByFloat64x4(t *testing.T) {
  function TestAVX2SumByTypeAlias (line 2248) | func TestAVX2SumByTypeAlias(t *testing.T) {
  function TestMeanByInt8x32 (line 2266) | func TestMeanByInt8x32(t *testing.T) {
  function TestMeanByInt16x16 (line 2299) | func TestMeanByInt16x16(t *testing.T) {
  function TestMeanByInt32x8 (line 2336) | func TestMeanByInt32x8(t *testing.T) {
  function TestMeanByInt64x4 (line 2373) | func TestMeanByInt64x4(t *testing.T) {
  function TestMeanByUint8x32 (line 2410) | func TestMeanByUint8x32(t *testing.T) {
  function TestMeanByUint16x16 (line 2447) | func TestMeanByUint16x16(t *testing.T) {
  function TestMeanByUint32x8 (line 2484) | func TestMeanByUint32x8(t *testing.T) {
  function TestMeanByUint64x4 (line 2520) | func TestMeanByUint64x4(t *testing.T) {
  function TestMeanByFloat32x8 (line 2556) | func TestMeanByFloat32x8(t *testing.T) {
  function TestMeanByFloat64x4 (line 2595) | func TestMeanByFloat64x4(t *testing.T) {
  function TestAVX2MeanByTypeAlias (line 2634) | func TestAVX2MeanByTypeAlias(t *testing.T) {

FILE: exp/simd/math_avx512.go
  function SumInt8x64 (line 18) | func SumInt8x64[T ~int8](collection []T) T {
  function SumInt16x32 (line 52) | func SumInt16x32[T ~int16](collection []T) T {
  function SumInt32x16 (line 86) | func SumInt32x16[T ~int32](collection []T) T {
  function SumInt64x8 (line 120) | func SumInt64x8[T ~int64](collection []T) T {
  function SumUint8x64 (line 154) | func SumUint8x64[T ~uint8](collection []T) T {
  function SumUint16x32 (line 188) | func SumUint16x32[T ~uint16](collection []T) T {
  function SumUint32x16 (line 222) | func SumUint32x16[T ~uint32](collection []T) T {
  function SumUint64x8 (line 256) | func SumUint64x8[T ~uint64](collection []T) T {
  function SumFloat32x16 (line 289) | func SumFloat32x16[T ~float32](collection []T) T {
  function SumFloat64x8 (line 322) | func SumFloat64x8[T ~float64](collection []T) T {
  function MeanInt8x64 (line 353) | func MeanInt8x64[T ~int8](collection []T) T {
  function MeanInt16x32 (line 363) | func MeanInt16x32[T ~int16](collection []T) T {
  function MeanInt32x16 (line 373) | func MeanInt32x16[T ~int32](collection []T) T {
  function MeanInt64x8 (line 383) | func MeanInt64x8[T ~int64](collection []T) T {
  function MeanUint8x64 (line 393) | func MeanUint8x64[T ~uint8](collection []T) T {
  function MeanUint16x32 (line 403) | func MeanUint16x32[T ~uint16](collection []T) T {
  function MeanUint32x16 (line 413) | func MeanUint32x16[T ~uint32](collection []T) T {
  function MeanUint64x8 (line 423) | func MeanUint64x8[T ~uint64](collection []T) T {
  function MeanFloat32x16 (line 433) | func MeanFloat32x16[T ~float32](collection []T) T {
  function MeanFloat64x8 (line 443) | func MeanFloat64x8[T ~float64](collection []T) T {
  function ClampInt8x64 (line 453) | func ClampInt8x64[T ~int8, Slice ~[]T](collection Slice, min, max T) Sli...
  function ClampInt16x32 (line 492) | func ClampInt16x32[T ~int16, Slice ~[]T](collection Slice, min, max T) S...
  function ClampInt32x16 (line 531) | func ClampInt32x16[T ~int32, Slice ~[]T](collection Slice, min, max T) S...
  function ClampInt64x2 (line 571) | func ClampInt64x2[T ~int64, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampUint64x2 (line 610) | func ClampUint64x2[T ~uint64, Slice ~[]T](collection Slice, min, max T) ...
  function ClampInt64x8 (line 648) | func ClampInt64x8[T ~int64, Slice ~[]T](collection Slice, min, max T) Sl...
  function ClampUint8x64 (line 687) | func ClampUint8x64[T ~uint8, Slice ~[]T](collection Slice, min, max T) S...
  function ClampUint16x32 (line 726) | func ClampUint16x32[T ~uint16, Slice ~[]T](collection Slice, min, max T)...
  function ClampUint32x16 (line 765) | func ClampUint32x16[T ~uint32, Slice ~[]T](collection Slice, min, max T)...
  function ClampUint64x8 (line 804) | func ClampUint64x8[T ~uint64, Slice ~[]T](collection Slice, min, max T) ...
  function ClampFloat32x16 (line 843) | func ClampFloat32x16[T ~float32, Slice ~[]T](collection Slice, min, max ...
  function ClampFloat64x8 (line 882) | func ClampFloat64x8[T ~float64, Slice ~[]T](collection Slice, min, max T...
  function MinInt8x64 (line 921) | func MinInt8x64[T ~int8](collection []T) T {
  function MinInt16x32 (line 975) | func MinInt16x32[T ~int16](collection []T) T {
  function MinInt32x16 (line 1025) | func MinInt32x16[T ~int32](collection []T) T {
  function MinInt64x2 (line 1074) | func MinInt64x2[T ~int64](collection []T) T {
  function MinUint64x2 (line 1119) | func MinUint64x2[T ~uint64](collection []T) T {
  function MinInt64x8 (line 1163) | func MinInt64x8[T ~int64](collection []T) T {
  function MinUint8x64 (line 1208) | func MinUint8x64[T ~uint8](collection []T) T {
  function MinUint16x32 (line 1262) | func MinUint16x32[T ~uint16](collection []T) T {
  function MinUint32x16 (line 1312) | func MinUint32x16[T ~uint32](collection []T) T {
  function MinUint64x8 (line 1360) | func MinUint64x8[T ~uint64](collection []T) T {
  function MinFloat32x16 (line 1405) | func MinFloat32x16[T ~float32](collection []T) T {
  function MinFloat64x8 (line 1453) | func MinFloat64x8[T ~float64](collection []T) T {
  function MaxInt8x64 (line 1498) | func MaxInt8x64[T ~int8](collection []T) T {
  function MaxInt16x32 (line 1552) | func MaxInt16x32[T ~int16](collection []T) T {
  function MaxInt32x16 (line 1602) | func MaxInt32x16[T ~int32](collection []T) T {
  function MaxInt64x2 (line 1651) | func MaxInt64x2[T ~int64](collection []T) T {
  function MaxUint64x2 (line 1696) | func MaxUint64x2[T ~uint64](collection []T) T {
  function MaxInt64x8 (line 1740) | func MaxInt64x8[T ~int64](collection []T) T {
  function MaxUint8x64 (line 1785) | func MaxUint8x64[T ~uint8](collection []T) T {
  function MaxUint16x32 (line 1839) | func MaxUint16x32[T ~uint16](collection []T) T {
  function MaxUint32x16 (line 1889) | func MaxUint32x16[T ~uint32](collection []T) T {
  function MaxUint64x8 (line 1937) | func MaxUint64x8[T ~uint64](collection []T) T {
  function MaxFloat32x16 (line 1982) | func MaxFloat32x16[T ~float32](collection []T) T {
  function MaxFloat64x8 (line 2030) | func MaxFloat64x8[T ~float64](collection []T) T {
  function SumByInt8x64 (line 2078) | func SumByInt8x64[T any, R ~int8](collection []T, iteratee func(item T) ...
  function SumByInt16x32 (line 2084) | func SumByInt16x32[T any, R ~int16](collection []T, iteratee func(item T...
  function SumByInt32x16 (line 2090) | func SumByInt32x16[T any, R ~int32](collection []T, iteratee func(item T...
  function SumByInt64x8 (line 2096) | func SumByInt64x8[T any, R ~int64](collection []T, iteratee func(item T)...
  function SumByUint8x64 (line 2102) | func SumByUint8x64[T any, R ~uint8](collection []T, iteratee func(item T...
  function SumByUint16x32 (line 2108) | func SumByUint16x32[T any, R ~uint16](collection []T, iteratee func(item...
  function SumByUint32x16 (line 2114) | func SumByUint32x16[T any, R ~uint32](collection []T, iteratee func(item...
  function SumByUint64x8 (line 2120) | func SumByUint64x8[T any, R ~uint64](collection []T, iteratee func(item ...
  function SumByFloat32x16 (line 2126) | func SumByFloat32x16[T any, R ~float32](collection []T, iteratee func(it...
  function SumByFloat64x8 (line 2132) | func SumByFloat64x8[T any, R ~float64](collection []T, iteratee func(ite...
  function MeanByInt8x64 (line 2141) | func MeanByInt8x64[T any, R ~int8](collection []T, iteratee func(item T)...
  function MeanByInt16x32 (line 2147) | func MeanByInt16x32[T any, R ~int16](collection []T, iteratee func(item ...
  function MeanByInt32x16 (line 2153) | func MeanByInt32x16[T any, R ~int32](collection []T, iteratee func(item ...
  function MeanByInt64x8 (line 2159) | func MeanByInt64x8[T any, R ~int64](collection []T, iteratee func(item T...
  function MeanByUint8x64 (line 2165) | func MeanByUint8x64[T any, R ~uint8](collection []T, iteratee func(item ...
  function MeanByUint16x32 (line 2171) | func MeanByUint16x32[T any, R ~uint16](collection []T, iteratee func(ite...
  function MeanByUint32x16 (line 2177) | func MeanByUint32x16[T any, R ~uint32](collection []T, iteratee func(ite...
  function MeanByUint64x8 (line 2183) | func MeanByUint64x8[T any, R ~uint64](collection []T, iteratee func(item...
  function MeanByFloat32x16 (line 2189) | func MeanByFloat32x16[T any, R ~float32](collection []T, iteratee func(i...
  function MeanByFloat64x8 (line 2195) | func MeanByFloat64x8[T any, R ~float64](collection []T, iteratee func(it...

FILE: exp/simd/math_avx512_test.go
  function TestSumInt8x64 (line 12) | func TestSumInt8x64(t *testing.T) {
  function TestSumInt16x32 (line 44) | func TestSumInt16x32(t *testing.T) {
  function TestSumInt32x16 (line 76) | func TestSumInt32x16(t *testing.T) {
  function TestSumInt64x8 (line 108) | func TestSumInt64x8(t *testing.T) {
  function TestSumUint8x64 (line 140) | func TestSumUint8x64(t *testing.T) {
  function TestSumUint16x32 (line 171) | func TestSumUint16x32(t *testing.T) {
  function TestSumUint32x16 (line 202) | func TestSumUint32x16(t *testing.T) {
  function TestSumUint64x8 (line 233) | func TestSumUint64x8(t *testing.T) {
  function TestSumFloat32x16 (line 264) | func TestSumFloat32x16(t *testing.T) {
  function TestSumFloat64x8 (line 297) | func TestSumFloat64x8(t *testing.T) {
  function TestAVX512TypeAlias (line 331) | func TestAVX512TypeAlias(t *testing.T) {
  function TestMeanInt8x64 (line 342) | func TestMeanInt8x64(t *testing.T) {
  function TestMeanInt16x32 (line 374) | func TestMeanInt16x32(t *testing.T) {
  function TestMeanInt32x16 (line 406) | func TestMeanInt32x16(t *testing.T) {
  function TestMeanInt64x8 (line 438) | func TestMeanInt64x8(t *testing.T) {
  function TestMeanUint8x64 (line 470) | func TestMeanUint8x64(t *testing.T) {
  function TestMeanUint16x32 (line 501) | func TestMeanUint16x32(t *testing.T) {
  function TestMeanUint32x16 (line 532) | func TestMeanUint32x16(t *testing.T) {
  function TestMeanUint64x8 (line 563) | func TestMeanUint64x8(t *testing.T) {
  function TestMeanFloat32x16 (line 594) | func TestMeanFloat32x16(t *testing.T) {
  function TestMeanFloat64x8 (line 627) | func TestMeanFloat64x8(t *testing.T) {
  function TestAVX512MeanTypeAlias (line 661) | func TestAVX512MeanTypeAlias(t *testing.T) {
  function TestClampInt8x64 (line 672) | func TestClampInt8x64(t *testing.T) {
  function TestClampInt16x32 (line 723) | func TestClampInt16x32(t *testing.T) {
  function TestClampInt32x16 (line 773) | func TestClampInt32x16(t *testing.T) {
  function TestClampInt64x2 (line 822) | func TestClampInt64x2(t *testing.T) {
  function TestClampInt64x8 (line 871) | func TestClampInt64x8(t *testing.T) {
  function TestClampUint8x64 (line 920) | func TestClampUint8x64(t *testing.T) {
  function TestClampUint16x32 (line 971) | func TestClampUint16x32(t *testing.T) {
  function TestClampUint32x16 (line 1021) | func TestClampUint32x16(t *testing.T) {
  function TestClampUint64x2 (line 1070) | func TestClampUint64x2(t *testing.T) {
  function TestClampUint64x8 (line 1119) | func TestClampUint64x8(t *testing.T) {
  function TestClampFloat32x16 (line 1168) | func TestClampFloat32x16(t *testing.T) {
  function TestClampFloat64x8 (line 1220) | func TestClampFloat64x8(t *testing.T) {
  function TestAVX512ClampTypeAlias (line 1273) | func TestAVX512ClampTypeAlias(t *testing.T) {
  function TestMinInt8x64 (line 1297) | func TestMinInt8x64(t *testing.T) {
  function TestMinInt16x32 (line 1329) | func TestMinInt16x32(t *testing.T) {
  function TestMinInt32x16 (line 1361) | func TestMinInt32x16(t *testing.T) {
  function TestMinInt64x2 (line 1393) | func TestMinInt64x2(t *testing.T) {
  function TestMinInt64x8 (line 1425) | func TestMinInt64x8(t *testing.T) {
  function TestMinUint8x64 (line 1457) | func TestMinUint8x64(t *testing.T) {
  function TestMinUint16x32 (line 1489) | func TestMinUint16x32(t *testing.T) {
  function TestMinUint32x16 (line 1521) | func TestMinUint32x16(t *testing.T) {
  function TestMinUint64x2 (line 1552) | func TestMinUint64x2(t *testing.T) {
  function TestMinUint64x8 (line 1583) | func TestMinUint64x8(t *testing.T) {
  function TestMinFloat32x16 (line 1614) | func TestMinFloat32x16(t *testing.T) {
  function TestMinFloat64x8 (line 1648) | func TestMinFloat64x8(t *testing.T) {
  function TestAVX512MinTypeAlias (line 1682) | func TestAVX512MinTypeAlias(t *testing.T) {
  function TestMaxInt8x64 (line 1693) | func TestMaxInt8x64(t *testing.T) {
  function TestMaxInt16x32 (line 1725) | func TestMaxInt16x32(t *testing.T) {
  function TestMaxInt32x16 (line 1757) | func TestMaxInt32x16(t *testing.T) {
  function TestMaxInt64x2 (line 1789) | func TestMaxInt64x2(t *testing.T) {
  function TestMaxInt64x8 (line 1821) | func TestMaxInt64x8(t *testing.T) {
  function TestMaxUint8x64 (line 1853) | func TestMaxUint8x64(t *testing.T) {
  function TestMaxUint16x32 (line 1885) | func TestMaxUint16x32(t *testing.T) {
  function TestMaxUint32x16 (line 1917) | func TestMaxUint32x16(t *testing.T) {
  function TestMaxUint64x2 (line 1948) | func TestMaxUint64x2(t *testing.T) {
  function TestMaxUint64x8 (line 1979) | func TestMaxUint64x8(t *testing.T) {
  function TestMaxFloat32x16 (line 2010) | func TestMaxFloat32x16(t *testing.T) {
  function TestMaxFloat64x8 (line 2044) | func TestMaxFloat64x8(t *testing.T) {
  function TestAVX512MaxTypeAlias (line 2078) | func TestAVX512MaxTypeAlias(t *testing.T) {
  type avx512Item (line 2091) | type avx512Item struct
  function TestSumByInt8x64 (line 2097) | func TestSumByInt8x64(t *testing.T) {
  function TestSumByInt16x32 (line 2131) | func TestSumByInt16x32(t *testing.T) {
  function TestSumByInt32x16 (line 2168) | func TestSumByInt32x16(t *testing.T) {
  function TestSumByInt64x8 (line 2205) | func TestSumByInt64x8(t *testing.T) {
  function TestSumByUint8x64 (line 2242) | func TestSumByUint8x64(t *testing.T) {
  function TestSumByUint16x32 (line 2279) | func TestSumByUint16x32(t *testing.T) {
  function TestSumByUint32x16 (line 2316) | func TestSumByUint32x16(t *testing.T) {
  function TestSumByUint64x8 (line 2352) | func TestSumByUint64x8(t *testing.T) {
  function TestSumByFloat32x16 (line 2388) | func TestSumByFloat32x16(t *testing.T) {
  function TestSumByFloat64x8 (line 2427) | func TestSumByFloat64x8(t *testing.T) {
  function TestAVX512SumByTypeAlias (line 2466) | func TestAVX512SumByTypeAlias(t *testing.T) {
  function TestMeanByInt8x64 (line 2484) | func TestMeanByInt8x64(t *testing.T) {
  function TestMeanByInt16x32 (line 2517) | func TestMeanByInt16x32(t *testing.T) {
  function TestMeanByInt32x16 (line 2554) | func TestMeanByInt32x16(t *testing.T) {
  function TestMeanByInt64x8 (line 2591) | func TestMeanByInt64x8(t *testing.T) {
  function TestMeanByUint8x64 (line 2628) | func TestMeanByUint8x64(t *testing.T) {
  function TestMeanByUint16x32 (line 2665) | func TestMeanByUint16x32(t *testing.T) {
  function TestMeanByUint32x16 (line 2702) | func TestMeanByUint32x16(t *testing.T) {
  function TestMeanByUint64x8 (line 2738) | func TestMeanByUint64x8(t *testing.T) {
  function TestMeanByFloat32x16 (line 2774) | func TestMeanByFloat32x16(t *testing.T) {
  function TestMeanByFloat64x8 (line 2813) | func TestMeanByFloat64x8(t *testing.T) {
  function TestAVX512MeanByTypeAlias (line 2852) | func TestAVX512MeanByTypeAlias(t *testing.T) {

FILE: exp/simd/math_avx_test.go
  function TestSumInt8x16 (line 12) | func TestSumInt8x16(t *testing.T) {
  function TestSumInt16x8 (line 45) | func TestSumInt16x8(t *testing.T) {
  function TestSumInt32x4 (line 78) | func TestSumInt32x4(t *testing.T) {
  function TestSumInt64x2 (line 110) | func TestSumInt64x2(t *testing.T) {
  function TestSumUint8x16 (line 142) | func TestSumUint8x16(t *testing.T) {
  function TestSumUint16x8 (line 174) | func TestSumUint16x8(t *testing.T) {
  function TestSumUint32x4 (line 206) | func TestSumUint32x4(t *testing.T) {
  function TestSumUint64x2 (line 237) | func TestSumUint64x2(t *testing.T) {
  function TestSumFloat32x4 (line 268) | func TestSumFloat32x4(t *testing.T) {
  function TestSumFloat64x2 (line 302) | func TestSumFloat64x2(t *testing.T) {
  function TestAVXTypeAlias (line 336) | func TestAVXTypeAlias(t *testing.T) {
  function TestClampInt8x16 (line 347) | func TestClampInt8x16(t *testing.T) {
  function TestClampInt16x8 (line 399) | func TestClampInt16x8(t *testing.T) {
  function TestClampInt32x4 (line 449) | func TestClampInt32x4(t *testing.T) {
  function TestClampUint8x16 (line 498) | func TestClampUint8x16(t *testing.T) {
  function TestClampUint16x8 (line 549) | func TestClampUint16x8(t *testing.T) {
  function TestClampUint32x4 (line 599) | func TestClampUint32x4(t *testing.T) {
  function TestClampFloat32x4 (line 648) | func TestClampFloat32x4(t *testing.T) {
  function TestClampFloat64x2 (line 700) | func TestClampFloat64x2(t *testing.T) {
  function TestAVXClampTypeAlias (line 753) | func TestAVXClampTypeAlias(t *testing.T) {
  function TestMeanInt8x16 (line 777) | func TestMeanInt8x16(t *testing.T) {
  function TestMeanInt16x8 (line 809) | func TestMeanInt16x8(t *testing.T) {
  function TestMeanInt32x4 (line 841) | func TestMeanInt32x4(t *testing.T) {
  function TestMeanInt64x2 (line 873) | func TestMeanInt64x2(t *testing.T) {
  function TestMeanUint8x16 (line 905) | func TestMeanUint8x16(t *testing.T) {
  function TestMeanUint16x8 (line 937) | func TestMeanUint16x8(t *testing.T) {
  function TestMeanUint32x4 (line 969) | func TestMeanUint32x4(t *testing.T) {
  function TestMeanUint64x2 (line 1000) | func TestMeanUint64x2(t *testing.T) {
  function TestMeanFloat32x4 (line 1031) | func TestMeanFloat32x4(t *testing.T) {
  function TestMeanFloat64x2 (line 1065) | func TestMeanFloat64x2(t *testing.T) {
  function TestAVXMeanTypeAlias (line 1099) | func TestAVXMeanTypeAlias(t *testing.T) {
  function TestMinInt8x16 (line 1110) | func TestMinInt8x16(t *testing.T) {
  function TestMinInt16x8 (line 1142) | func TestMinInt16x8(t *testing.T) {
  function TestMinInt32x4 (line 1174) | func TestMinInt32x4(t *testing.T) {
  function TestMinUint8x16 (line 1206) | func TestMinUint8x16(t *testing.T) {
  function TestMinUint16x8 (line 1238) | func TestMinUint16x8(t *testing.T) {
  function TestMinUint32x4 (line 1270) | func TestMinUint32x4(t *testing.T) {
  function TestMinFloat32x4 (line 1301) | func TestMinFloat32x4(t *testing.T) {
  function TestMinFloat64x2 (line 1335) | func TestMinFloat64x2(t *testing.T) {
  function TestAVXMinTypeAlias (line 1369) | func TestAVXMinTypeAlias(t *testing.T) {
  function TestMaxInt8x16 (line 1380) | func TestMaxInt8x16(t *testing.T) {
  function TestMaxInt16x8 (line 1412) | func TestMaxInt16x8(t *testing.T) {
  function TestMaxInt32x4 (line 1444) | func TestMaxInt32x4(t *testing.T) {
  function TestMaxUint8x16 (line 1476) | func TestMaxUint8x16(t *testing.T) {
  function TestMaxUint16x8 (line 1508) | func TestMaxUint16x8(t *testing.T) {
  function TestMaxUint32x4 (line 1540) | func TestMaxUint32x4(t *testing.T) {
  function TestMaxFloat32x4 (line 1571) | func TestMaxFloat32x4(t *testing.T) {
  function TestMaxFloat64x2 (line 1605) | func TestMaxFloat64x2(t *testing.T) {
  function TestAVXMaxTypeAlias (line 1639) | func TestAVXMaxTypeAlias(t *testing.T) {
  type item (line 1652) | type item struct
  function TestSumByInt8x16 (line 1658) | func TestSumByInt8x16(t *testing.T) {
  function TestSumByInt16x8 (line 1691) | func TestSumByInt16x8(t *testing.T) {
  function TestSumByInt32x4 (line 1727) | func TestSumByInt32x4(t *testing.T) {
  function TestSumByInt64x2 (line 1763) | func TestSumByInt64x2(t *testing.T) {
  function TestSumByUint8x16 (line 1799) | func TestSumByUint8x16(t *testing.T) {
  function TestSumByUint16x8 (line 1835) | func TestSumByUint16x8(t *testing.T) {
  function TestSumByUint32x4 (line 1871) | func TestSumByUint32x4(t *testing.T) {
  function TestSumByUint64x2 (line 1906) | func TestSumByUint64x2(t *testing.T) {
  function TestSumByFloat32x4 (line 1941) | func TestSumByFloat32x4(t *testing.T) {
  function TestSumByFloat64x2 (line 1979) | func TestSumByFloat64x2(t *testing.T) {
  function TestAVXSumByTypeAlias (line 2017) | func TestAVXSumByTypeAlias(t *testing.T) {
  function TestMeanByInt8x16 (line 2034) | func TestMeanByInt8x16(t *testing.T) {
  function TestMeanByInt16x8 (line 2066) | func TestMeanByInt16x8(t *testing.T) {
  function TestMeanByInt32x4 (line 2102) | func TestMeanByInt32x4(t *testing.T) {
  function TestMeanByInt64x2 (line 2138) | func TestMeanByInt64x2(t *testing.T) {
  function TestMeanByUint8x16 (line 2174) | func TestMeanByUint8x16(t *testing.T) {
  function TestMeanByUint16x8 (line 2210) | func TestMeanByUint16x8(t *testing.T) {
  function TestMeanByUint32x4 (line 2246) | func TestMeanByUint32x4(t *testing.T) {
  function TestMeanByUint64x2 (line 2281) | func TestMeanByUint64x2(t *testing.T) {
  function TestMeanByFloat32x4 (line 2316) | func TestMeanByFloat32x4(t *testing.T) {
  function TestMeanByFloat64x2 (line 2354) | func TestMeanByFloat64x2(t *testing.T) {
  function TestAVXMeanByTypeAlias (line 2392) | func TestAVXMeanByTypeAlias(t *testing.T) {

FILE: exp/simd/math_bench_test.go
  function init (line 29) | func init() {
  type benchDataGenerator (line 35) | type benchDataGenerator
  function generateInt8 (line 37) | func generateInt8(n int) []int8 {
  function generateInt16 (line 45) | func generateInt16(n int) []int16 {
  function generateInt32 (line 53) | func generateInt32(n int) []int32 {
  function generateInt64 (line 61) | func generateInt64(n int) []int64 {
  function generateUint8 (line 69) | func generateUint8(n int) []uint8 {
  function generateUint16 (line 77) | func generateUint16(n int) []uint16 {
  function generateUint32 (line 85) | func generateUint32(n int) []uint32 {
  function generateUint64 (line 93) | func generateUint64(n int) []uint64 {
  function generateFloat32 (line 101) | func generateFloat32(n int) []float32 {
  function generateFloat64 (line 109) | func generateFloat64(n int) []float64 {
  function BenchmarkSumInt8 (line 121) | func BenchmarkSumInt8(b *testing.B) {
  function BenchmarkSumInt16 (line 156) | func BenchmarkSumInt16(b *testing.B) {
  function BenchmarkSumInt32 (line 191) | func BenchmarkSumInt32(b *testing.B) {
  function BenchmarkSumInt64 (line 226) | func BenchmarkSumInt64(b *testing.B) {
  function BenchmarkSumFloat32 (line 261) | func BenchmarkSumFloat32(b *testing.B) {
  function BenchmarkSumFloat64 (line 296) | func BenchmarkSumFloat64(b *testing.B) {
  function BenchmarkMeanInt32 (line 335) | func BenchmarkMeanInt32(b *testing.B) {
  function BenchmarkMeanFloat64 (line 370) | func BenchmarkMeanFloat64(b *testing.B) {
  function BenchmarkMinInt32 (line 409) | func BenchmarkMinInt32(b *testing.B) {
  function BenchmarkMinFloat64 (line 438) | func BenchmarkMinFloat64(b *testing.B) {
  function BenchmarkMaxInt32 (line 471) | func BenchmarkMaxInt32(b *testing.B) {
  function BenchmarkMaxFloat64 (line 500) | func BenchmarkMaxFloat64(b *testing.B) {
  function BenchmarkSumInt8ByWidth (line 534) | func BenchmarkSumInt8ByWidth(b *testing.B) {
  function BenchmarkSumInt64SteadyState (line 572) | func BenchmarkSumInt64SteadyState(b *testing.B) {

FILE: exp/simd/simd_test.go
  function init (line 13) | func init() {
  type myInt8 (line 28) | type myInt8
  type myInt16 (line 29) | type myInt16
  type myInt32 (line 30) | type myInt32
  type myInt64 (line 31) | type myInt64
  type myUint8 (line 32) | type myUint8
  type myUint16 (line 33) | type myUint16
  type myUint32 (line 34) | type myUint32
  type myUint64 (line 35) | type myUint64
  type myFloat32 (line 36) | type myFloat32
  type myFloat64 (line 37) | type myFloat64

FILE: exp/simd/unsafe.go
  function unsafeSliceInt8 (line 11) | func unsafeSliceInt8[T ~int8](collection []T, length uint) []int8 {
  function unsafeSliceInt16 (line 19) | func unsafeSliceInt16[T ~int16](collection []T, length uint) []int16 {
  function unsafeSliceInt32 (line 27) | func unsafeSliceInt32[T ~int32](collection []T, length uint) []int32 {
  function unsafeSliceInt64 (line 35) | func unsafeSliceInt64[T ~int64](collection []T, length uint) []int64 {
  function unsafeSliceUint8 (line 43) | func unsafeSliceUint8[T ~uint8](collection []T, length uint) []uint8 {
  function unsafeSliceUint16 (line 51) | func unsafeSliceUint16[T ~uint16](collection []T, length uint) []uint16 {
  function unsafeSliceUint32 (line 59) | func unsafeSliceUint32[T ~uint32](collection []T, length uint) []uint32 {
  function unsafeSliceUint64 (line 67) | func unsafeSliceUint64[T ~uint64](collection []T, length uint) []uint64 {
  function unsafeSliceFloat32 (line 75) | func unsafeSliceFloat32[T ~float32](collection []T, length uint) []float...
  function unsafeSliceFloat64 (line 83) | func unsafeSliceFloat64[T ~float64](collection []T, length uint) []float...

FILE: find.go
  function IndexOf (line 13) | func IndexOf[T comparable](collection []T, element T) int {
  function LastIndexOf (line 26) | func LastIndexOf[T comparable](collection []T, element T) int {
  function HasPrefix (line 40) | func HasPrefix[T comparable](collection, prefix []T) bool {
  function HasSuffix (line 56) | func HasSuffix[T comparable](collection, suffix []T) bool {
  function Find (line 72) | func Find[T any](collection []T, predicate func(item T) bool) (T, bool) {
  function FindErr (line 88) | func FindErr[T any](collection []T, predicate func(item T) (bool, error)...
  function FindIndexOf (line 107) | func FindIndexOf[T any](collection []T, predicate func(item T) bool) (T,...
  function FindLastIndexOf (line 121) | func FindLastIndexOf[T any](collection []T, predicate func(item T) bool)...
  function FindOrElse (line 136) | func FindOrElse[T any](collection []T, fallback T, predicate func(item T...
  function FindKey (line 148) | func FindKey[K, V comparable](object map[K]V, value V) (K, bool) {
  function FindKeyBy (line 160) | func FindKeyBy[K comparable, V any](object map[K]V, predicate func(key K...
  function FindUniques (line 173) | func FindUniques[T comparable, Slice ~[]T](collection Slice) Slice {
  function FindUniquesBy (line 204) | func FindUniquesBy[T any, U comparable, Slice ~[]T](collection Slice, it...
  function FindDuplicates (line 238) | func FindDuplicates[T comparable, Slice ~[]T](collection Slice) Slice {
  function FindDuplicatesBy (line 270) | func FindDuplicatesBy[T any, U comparable, Slice ~[]T](collection Slice,...
  function FindDuplicatesByErr (line 307) | func FindDuplicatesByErr[T any, U comparable, Slice ~[]T](collection Sli...
  function Min (line 352) | func Min[T constraints.Ordered](collection []T) T {
  function MinIndex (line 375) | func MinIndex[T constraints.Ordered](collection []T) (T, int) {
  function MinBy (line 403) | func MinBy[T any](collection []T, less func(a, b T) bool) T {
  function MinByErr (line 428) | func MinByErr[T any](collection []T, less func(a, b T) (bool, error)) (T...
  function MinIndexBy (line 457) | func MinIndexBy[T any](collection []T, less func(a, b T) bool) (T, int) {
  function MinIndexByErr (line 486) | func MinIndexByErr[T any](collection []T, less func(a, b T) (bool, error...
  function Earliest (line 519) | func Earliest(times ...time.Time) time.Time {
  function EarliestBy (line 542) | func EarliestBy[T any](collection []T, iteratee func(item T) time.Time) T {
  function EarliestByErr (line 568) | func EarliestByErr[T any](collection []T, iteratee func(item T) (time.Ti...
  function Max (line 599) | func Max[T constraints.Ordered](collection []T) T {
  function MaxIndex (line 622) | func MaxIndex[T constraints.Ordered](collection []T) (T, int) {
  function MaxBy (line 654) | func MaxBy[T any](collection []T, greater func(a, b T) bool) T {
  function MaxByErr (line 683) | func MaxByErr[T any](collection []T, greater func(a, b T) (bool, error))...
  function MaxIndexBy (line 715) | func MaxIndexBy[T any](collection []T, greater func(a, b T) bool) (T, in...
  function MaxIndexByErr (line 746) | func MaxIndexByErr[T any](collection []T, greater func(a, b T) (bool, er...
  function Latest (line 778) | func Latest(times ...time.Time) time.Time {
  function LatestBy (line 801) | func LatestBy[T any](collection []T, iteratee func(item T) time.Time) T {
  function LatestByErr (line 827) | func LatestByErr[T any](collection []T, iteratee func(item T) (time.Time...
  function First (line 857) | func First[T any](collection []T) (T, bool) {
  function FirstOrEmpty (line 870) | func FirstOrEmpty[T any](collection []T) T {
  function FirstOr (line 877) | func FirstOr[T any](collection []T, fallback T) T {
  function Last (line 888) | func Last[T any](collection []T) (T, bool) {
  function LastOrEmpty (line 901) | func LastOrEmpty[T any](collection []T) T {
  function LastOr (line 908) | func LastOr[T any](collection []T, fallback T) T {
  function Nth (line 920) | func Nth[T any, N constraints.Integer](collection []T, nth N) (T, error) {
  function sliceNth (line 926) | func sliceNth[T any, N constraints.Integer](collection []T, nth N) (T, b...
  function NthOr (line 943) | func NthOr[T any, N constraints.Integer](collection []T, nth N, fallback...
  function NthOrEmpty (line 955) | func NthOrEmpty[T any, N constraints.Integer](collection []T, nth N) T {
  type randomIntGenerator (line 962) | type randomIntGenerator
  function Sample (line 966) | func Sample[T any](collection []T) T {
  function SampleBy (line 972) | func SampleBy[T any](collection []T, randomIntGenerator randomIntGenerat...
  function Samples (line 982) | func Samples[T any, Slice ~[]T](collection Slice, count int) Slice {
  function SamplesBy (line 988) | func SamplesBy[T any, Slice ~[]T](collection Slice, count int, randomInt...

FILE: find_test.go
  function TestIndexOf (line 12) | func TestIndexOf(t *testing.T) {
  function TestLastIndexOf (line 23) | func TestLastIndexOf(t *testing.T) {
  function TestHasPrefix (line 34) | func TestHasPrefix(t *testing.T) {
  function TestHasSuffix (line 43) | func TestHasSuffix(t *testing.T) {
  function TestFind (line 52) | func TestFind(t *testing.T) {
  function TestFindErr (line 74) | func TestFindErr(t *testing.T) {
  function TestFindIndexOf (line 178) | func TestFindIndexOf(t *testing.T) {
  function TestFindLastIndexOf (line 201) | func TestFindLastIndexOf(t *testing.T) {
  function TestFindOrElse (line 224) | func TestFindOrElse(t *testing.T) {
  function TestFindKey (line 243) | func TestFindKey(t *testing.T) {
  function TestFindKeyBy (line 268) | func TestFindKeyBy(t *testing.T) {
  function TestFindUniques (line 285) | func TestFindUniques(t *testing.T) {
  function TestFindUniquesBy (line 307) | func TestFindUniquesBy(t *testing.T) {
  function TestFindDuplicates (line 339) | func TestFindDuplicates(t *testing.T) {
  function TestFindDuplicatesBy (line 358) | func TestFindDuplicatesBy(t *testing.T) {
  function TestFindDuplicatesByErr (line 385) | func TestFindDuplicatesByErr(t *testing.T) {
  function TestMin (line 488) | func TestMin(t *testing.T) {
  function TestMinIndex (line 503) | func TestMinIndex(t *testing.T) {
  function TestMinBy (line 525) | func TestMinBy(t *testing.T) {
  function TestMinByErr (line 544) | func TestMinByErr(t *testing.T) {
  function TestMinIndexBy (line 637) | func TestMinIndexBy(t *testing.T) {
  function TestMinIndexByErr (line 661) | func TestMinIndexByErr(t *testing.T) {
  function TestEarliest (line 761) | func TestEarliest(t *testing.T) {
  function TestEarliestBy (line 774) | func TestEarliestBy(t *testing.T) {
  function TestEarliestByErr (line 800) | func TestEarliestByErr(t *testing.T) {
  function TestMax (line 896) | func TestMax(t *testing.T) {
  function TestMaxIndex (line 911) | func TestMaxIndex(t *testing.T) {
  function TestMaxBy (line 933) | func TestMaxBy(t *testing.T) {
  function TestMaxByErr (line 952) | func TestMaxByErr(t *testing.T) {
  function TestMaxIndexBy (line 1050) | func TestMaxIndexBy(t *testing.T) {
  function TestMaxIndexByErr (line 1074) | func TestMaxIndexByErr(t *testing.T) {
  function TestLatest (line 1181) | func TestLatest(t *testing.T) {
  function TestLatestBy (line 1194) | func TestLatestBy(t *testing.T) {
  function TestLatestByErr (line 1220) | func TestLatestByErr(t *testing.T) {
  function TestFirst (line 1316) | func TestFirst(t *testing.T) {
  function TestFirstOrEmpty (line 1329) | func TestFirstOrEmpty(t *testing.T) {
  function TestFirstOr (line 1342) | func TestFirstOr(t *testing.T) {
  function TestLast (line 1355) | func TestLast(t *testing.T) {
  function TestLastOrEmpty (line 1368) | func TestLastOrEmpty(t *testing.T) {
  function TestLastOr (line 1381) | func TestLastOr(t *testing.T) {
  function TestNth (line 1394) | func TestNth(t *testing.T) {
  function TestNthOr (line 1419) | func TestNthOr(t *testing.T) {
  function TestNthOrEmpty (line 1471) | func TestNthOrEmpty(t *testing.T) {
  function TestSample (line 1520) | func TestSample(t *testing.T) {
  function TestSampleBy (line 1531) | func TestSampleBy(t *testing.T) {
  function TestSamples (line 1544) | func TestSamples(t *testing.T) {
  function TestSamplesBy (line 1560) | func TestSamplesBy(t *testing.T) {

FILE: func.go
  function Partial (line 5) | func Partial[T1, T2, R any](f func(a T1, b T2) R, arg1 T1) func(T2) R {
  function Partial1 (line 13) | func Partial1[T1, T2, R any](f func(T1, T2) R, arg1 T1) func(T2) R {
  function Partial2 (line 19) | func Partial2[T1, T2, T3, R any](f func(T1, T2, T3) R, arg1 T1) func(T2,...
  function Partial3 (line 27) | func Partial3[T1, T2, T3, T4, R any](f func(T1, T2, T3, T4) R, arg1 T1) ...
  function Partial4 (line 35) | func Partial4[T1, T2, T3, T4, T5, R any](f func(T1, T2, T3, T4, T5) R, a...
  function Partial5 (line 43) | func Partial5[T1, T2, T3, T4, T5, T6, R any](f func(T1, T2, T3, T4, T5, ...

FILE: func_test.go
  function TestPartial (line 10) | func TestPartial(t *testing.T) {
  function TestPartial1 (line 22) | func TestPartial1(t *testing.T) {
  function TestPartial2 (line 34) | func TestPartial2(t *testing.T) {
  function TestPartial3 (line 46) | func TestPartial3(t *testing.T) {
  function TestPartial4 (line 58) | func TestPartial4(t *testing.T) {
  function TestPartial5 (line 70) | func TestPartial5(t *testing.T) {

FILE: internal/constraints/constraints.go
  type Signed (line 12) | type Signed interface
  type Unsigned (line 19) | type Unsigned interface
  type Integer (line 26) | type Integer interface
  type Float (line 33) | type Float interface
  type Complex (line 40) | type Complex interface

FILE: internal/constraints/ordered_go118.go
  type Ordered (line 9) | type Ordered interface

FILE: internal/xrand/ordered_go118.go
  function Shuffle (line 8) | func Shuffle(n int, swap func(i, j int)) {
  function IntN (line 15) | func IntN(n int) int {
  function Int64 (line 22) | func Int64() int64 {

FILE: internal/xrand/ordered_go122.go
  function Shuffle (line 8) | func Shuffle(n int, swap func(i, j int)) {
  function IntN (line 15) | func IntN(n int) int {
  function Int64 (line 21) | func Int64() int64 {

FILE: internal/xtime/fake.go
  function NewFakeClock (line 8) | func NewFakeClock() *FakeClock {
  function NewFakeClockAt (line 12) | func NewFakeClockAt(t time.Time) *FakeClock {
  type FakeClock (line 18) | type FakeClock struct
    method Now (line 26) | func (c *FakeClock) Now() time.Time {
    method Since (line 30) | func (c *FakeClock) Since(t time.Time) time.Duration {
    method Until (line 34) | func (c *FakeClock) Until(t time.Time) time.Duration {
    method Sleep (line 38) | func (c *FakeClock) Sleep(d time.Duration) {

FILE: internal/xtime/noCopy.go
  type noCopy (line 10) | type noCopy struct
    method Lock (line 13) | func (*noCopy) Lock()   {}
    method Unlock (line 14) | func (*noCopy) Unlock() {}

FILE: internal/xtime/real.go
  function NewRealClock (line 8) | func NewRealClock() *RealClock {
  type RealClock (line 12) | type RealClock struct
    method Now (line 16) | func (c *RealClock) Now() time.Time {
    method Since (line 20) | func (c *RealClock) Since(t time.Time) time.Duration {
    method Until (line 24) | func (c *RealClock) Until(t time.Time) time.Duration {
    method Sleep (line 28) | func (c *RealClock) Sleep(d time.Duration) {

FILE: internal/xtime/time.go
  function SetClock (line 8) | func SetClock(c Clock) {
  function Now (line 12) | func Now() time.Time {
  function Since (line 16) | func Since(t time.Time) time.Duration {
  function Until (line 20) | func Until(t time.Time) time.Duration {
  function Sleep (line 24) | func Sleep(d time.Duration) {
  type Clock (line 28) | type Clock interface

FILE: intersect.go
  function Contains (line 5) | func Contains[T comparable](collection []T, element T) bool {
  function ContainsBy (line 17) | func ContainsBy[T any](collection []T, predicate func(item T) bool) bool {
  function Every (line 29) | func Every[T comparable](collection, subset []T) bool {
  function EveryBy (line 47) | func EveryBy[T any](collection []T, predicate func(item T) bool) bool {
  function Some (line 60) | func Some[T comparable](collection, subset []T) bool {
  function SomeBy (line 78) | func SomeBy[T any](collection []T, predicate func(item T) bool) bool {
  function None (line 90) | func None[T comparable](collection, subset []T) bool {
  function NoneBy (line 107) | func NoneBy[T any](collection []T, predicate func(item T) bool) bool {
  function Intersect (line 119) | func Intersect[T comparable, Slice ~[]T](lists ...Slice) Slice {
  function IntersectBy (line 162) | func IntersectBy[T any, K comparable, Slice ~[]T](transform func(T) K, l...
  function Difference (line 210) | func Difference[T comparable, Slice ~[]T](list1, list2 Slice) (Slice, Sl...
  function Union (line 235) | func Union[T comparable, Slice ~[]T](lists ...Slice) Slice {
  function Without (line 259) | func Without[T comparable, Slice ~[]T](collection Slice, exclude ...T) S...
  function WithoutBy (line 274) | func WithoutBy[T any, K comparable, Slice ~[]T](collection Slice, iterat...
  function WithoutByErr (line 288) | func WithoutByErr[T any, K comparable, Slice ~[]T](collection Slice, ite...
  function WithoutEmpty (line 308) | func WithoutEmpty[T comparable, Slice ~[]T](collection Slice) Slice {
  function WithoutNth (line 314) | func WithoutNth[T any, Slice ~[]T](collection Slice, nths ...int) Slice {
  function ElementsMatch (line 331) | func ElementsMatch[T comparable, Slice ~[]T](list1, list2 Slice) bool {
  function ElementsMatchBy (line 339) | func ElementsMatchBy[T any, K comparable](list1, list2 []T, iteratee fun...

FILE: intersect_test.go
  function TestContains (line 11) | func TestContains(t *testing.T) {
  function TestContainsBy (line 22) | func TestContainsBy(t *testing.T) {
  function TestEvery (line 45) | func TestEvery(t *testing.T) {
  function TestEveryBy (line 60) | func TestEveryBy(t *testing.T) {
  function TestSome (line 89) | func TestSome(t *testing.T) {
  function TestSomeBy (line 104) | func TestSomeBy(t *testing.T) {
  function TestNone (line 133) | func TestNone(t *testing.T) {
  function TestNoneBy (line 148) | func TestNoneBy(t *testing.T) {
  function TestIntersect (line 177) | func TestIntersect(t *testing.T) {
  function TestIntersectBy (line 211) | func TestIntersectBy(t *testing.T) {
  function TestDifference (line 254) | func TestDifference(t *testing.T) {
  function TestUnion (line 277) | func TestUnion(t *testing.T) {
  function TestWithout (line 311) | func TestWithout(t *testing.T) {
  function TestWithoutBy (line 332) | func TestWithoutBy(t *testing.T) {
  function TestWithoutByErr (line 359) | func TestWithoutByErr(t *testing.T) {
  function TestWithoutEmpty (line 491) | func TestWithoutEmpty(t *testing.T) {
  function TestWithoutNth (line 510) | func TestWithoutNth(t *testing.T) {
  function TestElementsMatch (line 536) | func TestElementsMatch(t *testing.T) {
  function TestElementsMatchBy (line 552) | func TestElementsMatchBy(t *testing.T) {

FILE: it/channel.go
  function SeqToChannel (line 13) | func SeqToChannel[T any](bufferSize int, collection iter.Seq[T]) <-chan T {
  function SeqToChannel2 (line 29) | func SeqToChannel2[K, V any](bufferSize int, collection iter.Seq2[K, V])...
  function ChannelToSeq (line 45) | func ChannelToSeq[T any](ch <-chan T) iter.Seq[T] {

FILE: it/channel_test.go
  function TestSeqToChannel (line 14) | func TestSeqToChannel(t *testing.T) {
  function TestSeqToChannel2 (line 34) | func TestSeqToChannel2(t *testing.T) {
  function TestChannelToSeq (line 52) | func TestChannelToSeq(t *testing.T) {

FILE: it/find.go
  function IndexOf (line 19) | func IndexOf[T comparable](collection iter.Seq[T], element T) int {
  function LastIndexOf (line 35) | func LastIndexOf[T comparable](collection iter.Seq[T], element T) int {
  function HasPrefix (line 51) | func HasPrefix[T comparable](collection iter.Seq[T], prefix ...T) bool {
  function HasSuffix (line 74) | func HasSuffix[T comparable](collection iter.Seq[T], suffix ...T) bool {
  function Find (line 103) | func Find[T any](collection iter.Seq[T], predicate func(item T) bool) (T...
  function FindIndexOf (line 117) | func FindIndexOf[T any](collection iter.Seq[T], predicate func(item T) b...
  function FindLastIndexOf (line 133) | func FindLastIndexOf[T any](collection iter.Seq[T], predicate func(item ...
  function FindOrElse (line 154) | func FindOrElse[T any](collection iter.Seq[T], fallback T, predicate fun...
  function FindUniques (line 167) | func FindUniques[T comparable, I ~func(func(T) bool)](collection I) I {
  function FindUniquesBy (line 177) | func FindUniquesBy[T any, U comparable, I ~func(func(T) bool)](collectio...
  function FindDuplicates (line 205) | func FindDuplicates[T comparable, I ~func(func(T) bool)](collection I) I {
  function FindDuplicatesBy (line 215) | func FindDuplicatesBy[T any, U comparable, I ~func(func(T) bool)](collec...
  function Min (line 238) | func Min[T constraints.Ordered](collection iter.Seq[T]) T {
  function MinIndex (line 246) | func MinIndex[T constraints.Ordered](collection iter.Seq[T]) (T, int) {
  function MinBy (line 255) | func MinBy[T any](collection iter.Seq[T], comparison func(a, b T) bool) T {
  function MinIndexBy (line 276) | func MinIndexBy[T any](collection iter.Seq[T], comparison func(a, b T) b...
  function Earliest (line 296) | func Earliest(times iter.Seq[time.Time]) time.Time {
  function EarliestBy (line 304) | func EarliestBy[T any](collection iter.Seq[T], transform func(item T) ti...
  function Max (line 312) | func Max[T constraints.Ordered](collection iter.Seq[T]) T {
  function MaxIndex (line 320) | func MaxIndex[T constraints.Ordered](collection iter.Seq[T]) (T, int) {
  function MaxBy (line 329) | func MaxBy[T any](collection iter.Seq[T], comparison func(a, b T) bool) T {
  function MaxIndexBy (line 350) | func MaxIndexBy[T any](collection iter.Seq[T], comparison func(a, b T) b...
  function Latest (line 370) | func Latest(times iter.Seq[time.Time]) time.Time {
  function LatestBy (line 378) | func LatestBy[T any](collection iter.Seq[T], transform func(item T) time...
  function First (line 385) | func First[T any](collection iter.Seq[T]) (T, bool) {
  function FirstOrEmpty (line 396) | func FirstOrEmpty[T any](collection iter.Seq[T]) T {
  function FirstOr (line 404) | func FirstOr[T any](collection iter.Seq[T], fallback T) T {
  function Last (line 415) | func Last[T any](collection iter.Seq[T]) (T, bool) {
  function LastOrEmpty (line 429) | func LastOrEmpty[T any](collection iter.Seq[T]) T {
  function LastOr (line 437) | func LastOr[T any](collection iter.Seq[T], fallback T) T {
  function Nth (line 448) | func Nth[T any, N constraints.Integer](collection iter.Seq[T], nth N) (T...
  function seqNth (line 454) | func seqNth[T any, N constraints.Integer](collection iter.Seq[T], nth N)...
  function NthOr (line 472) | func NthOr[T any, N constraints.Integer](collection iter.Seq[T], nth N, ...
  function NthOrEmpty (line 484) | func NthOrEmpty[T any, N constraints.Integer](collection iter.Seq[T], nt...
  function Sample (line 493) | func Sample[T any](collection iter.Seq[T]) T {
  function SampleBy (line 501) | func SampleBy[T any](collection iter.Seq[T], randomIntGenerator func(int...
  function Samples (line 510) | func Samples[T any, I ~func(func(T) bool)](collection I, count int) I {
  function SamplesBy (line 518) | func SamplesBy[T any, I ~func(func(T) bool)](collection I, count int, ra...

FILE: it/find_example_test.go
  function ExampleIndexOf (line 11) | func ExampleIndexOf() {
  function ExampleIndexOf_notFound (line 20) | func ExampleIndexOf_notFound() {
  function ExampleLastIndexOf (line 29) | func ExampleLastIndexOf() {
  function ExampleLastIndexOf_notFound (line 38) | func ExampleLastIndexOf_notFound() {
  function ExampleFind (line 47) | func ExampleFind() {
  function ExampleFind_notFound (line 67) | func ExampleFind_notFound() {
  function ExampleFindIndexOf (line 78) | func ExampleFindIndexOf() {
  function ExampleFindIndexOf_notFound (line 89) | func ExampleFindIndexOf_notFound() {
  function ExampleFindLastIndexOf (line 100) | func ExampleFindLastIndexOf() {
  function ExampleFindLastIndexOf_notFound (line 111) | func ExampleFindLastIndexOf_notFound() {
  function ExampleFindOrElse (line 122) | func ExampleFindOrElse() {
  function ExampleFindOrElse_found (line 133) | func ExampleFindOrElse_found() {
  function ExampleFindUniques (line 144) | func ExampleFindUniques() {
  function ExampleFindUniquesBy (line 153) | func ExampleFindUniquesBy() {
  function ExampleFindDuplicates (line 175) | func ExampleFindDuplicates() {
  function ExampleFindDuplicatesBy (line 184) | func ExampleFindDuplicatesBy() {
  function ExampleMin (line 206) | func ExampleMin() {
  function ExampleMin_empty (line 215) | func ExampleMin_empty() {
  function ExampleMinIndex (line 224) | func ExampleMinIndex() {
  function ExampleMinIndex_empty (line 233) | func ExampleMinIndex_empty() {
  function ExampleMinBy (line 242) | func ExampleMinBy() {
  function ExampleMinIndexBy (line 262) | func ExampleMinIndexBy() {
  function ExampleEarliest (line 282) | func ExampleEarliest() {
  function ExampleEarliestBy (line 293) | func ExampleEarliestBy() {
  function ExampleMax (line 314) | func ExampleMax() {
  function ExampleMax_empty (line 323) | func ExampleMax_empty() {
  function ExampleMaxIndex (line 332) | func ExampleMaxIndex() {
  function ExampleMaxIndex_empty (line 341) | func ExampleMaxIndex_empty() {
  function ExampleMaxBy (line 350) | func ExampleMaxBy() {
  function ExampleMaxIndexBy (line 370) | func ExampleMaxIndexBy() {
  function ExampleLatest (line 390) | func ExampleLatest() {
  function ExampleLatestBy (line 401) | func ExampleLatestBy() {
  function ExampleFirst (line 422) | func ExampleFirst() {
  function ExampleFirst_empty (line 431) | func ExampleFirst_empty() {
  function ExampleFirstOrEmpty (line 440) | func ExampleFirstOrEmpty() {
  function ExampleFirstOrEmpty_empty (line 449) | func ExampleFirstOrEmpty_empty() {
  function ExampleFirstOr (line 458) | func ExampleFirstOr() {
  function ExampleFirstOr_empty (line 467) | func ExampleFirstOr_empty() {
  function ExampleLast (line 476) | func ExampleLast() {
  function ExampleLast_empty (line 485) | func ExampleLast_empty() {
  function ExampleLastOrEmpty (line 494) | func ExampleLastOrEmpty() {
  function ExampleLastOrEmpty_empty (line 503) | func ExampleLastOrEmpty_empty() {
  function ExampleLastOr (line 512) | func ExampleLastOr() {
  function ExampleLastOr_empty (line 521) | func ExampleLastOr_empty() {
  function ExampleNth (line 530) | func ExampleNth() {
  function ExampleNth_outOfBounds (line 539) | func ExampleNth_outOfBounds() {
  function ExampleNthOr (line 548) | func ExampleNthOr() {
  function ExampleNthOr_outOfBounds (line 557) | func ExampleNthOr_outOfBounds() {
  function ExampleNthOrEmpty (line 566) | func ExampleNthOrEmpty() {
  function ExampleNthOrEmpty_outOfBounds (line 575) | func ExampleNthOrEmpty_outOfBounds() {

FILE: it/find_test.go
  function TestIndexOf (line 16) | func TestIndexOf(t *testing.T) {
  function TestLastIndexOf (line 27) | func TestLastIndexOf(t *testing.T) {
  function TestHasPrefix (line 38) | func TestHasPrefix(t *testing.T) {
  function TestHasSuffix (line 49) | func TestHasSuffix(t *testing.T) {
  function TestFind (line 62) | func TestFind(t *testing.T) {
  function TestFindIndexOf (line 84) | func TestFindIndexOf(t *testing.T) {
  function TestFindLastIndexOf (line 107) | func TestFindLastIndexOf(t *testing.T) {
  function TestFindOrElse (line 126) | func TestFindOrElse(t *testing.T) {
  function TestFindUniques (line 145) | func TestFindUniques(t *testing.T) {
  function TestFindUniquesBy (line 167) | func TestFindUniquesBy(t *testing.T) {
  function TestFindDuplicates (line 199) | func TestFindDuplicates(t *testing.T) {
  function TestFindDuplicatesBy (line 218) | func TestFindDuplicatesBy(t *testing.T) {
  function TestMin (line 245) | func TestMin(t *testing.T) {
  function TestMinIndex (line 260) | func TestMinIndex(t *testing.T) {
  function TestMinBy (line 282) | func TestMinBy(t *testing.T) {
  function TestMinIndexBy (line 301) | func TestMinIndexBy(t *testing.T) {
  function TestEarliest (line 325) | func TestEarliest(t *testing.T) {
  function TestEarliestBy (line 338) | func TestEarliestBy(t *testing.T) {
  function TestMax (line 364) | func TestMax(t *testing.T) {
  function TestMaxIndex (line 379) | func TestMaxIndex(t *testing.T) {
  function TestMaxBy (line 401) | func TestMaxBy(t *testing.T) {
  function TestMaxIndexBy (line 420) | func TestMaxIndexBy(t *testing.T) {
  function TestLatest (line 444) | func TestLatest(t *testing.T) {
  function TestLatestBy (line 457) | func TestLatestBy(t *testing.T) {
  function TestFirst (line 483) | func TestFirst(t *testing.T) {
  function TestFirstOrEmpty (line 496) | func TestFirstOrEmpty(t *testing.T) {
  function TestFirstOr (line 509) | func TestFirstOr(t *testing.T) {
  function TestLast (line 522) | func TestLast(t *testing.T) {
  function TestLastOrEmpty (line 535) | func TestLastOrEmpty(t *testing.T) {
  function TestLastOr (line 548) | func TestLastOr(t *testing.T) {
  function TestNth (line 561) | func TestNth(t *testing.T) {
  function TestNthOr (line 586) | func TestNthOr(t *testing.T) {
  function TestNthOrEmpty (line 634) | func TestNthOrEmpty(t *testing.T) {
  function TestSample (line 679) | func TestSample(t *testing.T) {
  function TestSampleBy (line 690) | func TestSampleBy(t *testing.T) {
  function TestSamples (line 701) | func TestSamples(t *testing.T) {
  function TestSamplesBy (line 717) | func TestSamplesBy(t *testing.T) {

FILE: it/intersect.go
  function Contains (line 14) | func Contains[T comparable](collection iter.Seq[T], element T) bool {
  function ContainsBy (line 20) | func ContainsBy[T any](collection iter.Seq[T], predicate func(item T) bo...
  function Every (line 33) | func Every[T comparable](collection iter.Seq[T], subset ...T) bool {
  function EveryBy (line 53) | func EveryBy[T any](collection iter.Seq[T], predicate func(item T) bool)...
  function Some (line 67) | func Some[T comparable](collection iter.Seq[T], subset ...T) bool {
  function SomeBy (line 82) | func SomeBy[T any](collection iter.Seq[T], predicate func(item T) bool) ...
  function None (line 95) | func None[T comparable](collection iter.Seq[T], subset ...T) bool {
  function NoneBy (line 109) | func NoneBy[T any](collection iter.Seq[T], predicate func(item T) bool) ...
  function Intersect (line 123) | func Intersect[T comparable, I ~func(func(T) bool)](lists ...I) I {
  function IntersectBy (line 169) | func IntersectBy[T any, K comparable, I ~func(func(T) bool)](transform f...
  function Union (line 217) | func Union[T comparable, I ~func(func(T) bool)](lists ...I) I {
  function Without (line 237) | func Without[T comparable, I ~func(func(T) bool)](collection I, exclude ...
  function WithoutBy (line 245) | func WithoutBy[T any, K comparable, I ~func(func(T) bool)](collection I,...
  function WithoutNth (line 253) | func WithoutNth[T comparable, I ~func(func(T) bool)](collection I, nths ...
  function ElementsMatch (line 264) | func ElementsMatch[T comparable](list1, list2 iter.Seq[T]) bool {
  function ElementsMatchBy (line 274) | func ElementsMatchBy[T any, K comparable](list1, list2 iter.Seq[T], tran...

FILE: it/intersect_example_test.go
  function ExampleWithoutBy (line 10) | func ExampleWithoutBy() {

FILE: it/intersect_test.go
  function TestContains (line 14) | func TestContains(t *testing.T) {
  function TestContainsBy (line 25) | func TestContainsBy(t *testing.T) {
  function TestEvery (line 48) | func TestEvery(t *testing.T) {
  function TestEveryBy (line 63) | func TestEveryBy(t *testing.T) {
  function TestSome (line 92) | func TestSome(t *testing.T) {
  function TestSomeBy (line 107) | func TestSomeBy(t *testing.T) {
  function TestNone (line 136) | func TestNone(t *testing.T) {
  function TestNoneBy (line 151) | func TestNoneBy(t *testing.T) {
  function TestIntersect (line 180) | func TestIntersect(t *testing.T) {
  function TestIntersectBy (line 212) | func TestIntersectBy(t *testing.T) {
  function TestUnion (line 246) | func TestUnion(t *testing.T) {
  function TestWithout (line 280) | func TestWithout(t *testing.T) {
  function TestWithoutBy (line 301) | func TestWithoutBy(t *testing.T) {
  function TestWithoutNth (line 326) | func TestWithoutNth(t *testing.T) {
  function TestElementsMatch (line 348) | func TestElementsMatch(t *testing.T) {
  function TestElementsMatchBy (line 363) | func TestElementsMatchBy(t *testing.T) {

FILE: it/lo_test.go
  function assertSeqSupportBreak (line 14) | func assertSeqSupportBreak[T any](t *testing.T, seq iter.Seq[T]) iter.Se...
  function values (line 29) | func values[T any](v ...T) iter.Seq[T] { return slices.Values(v) }
  type foo (line 31) | type foo struct
    method Clone (line 35) | func (f foo) Clone() foo {

FILE: it/map.go
  function Keys (line 12) | func Keys[K comparable, V any](in ...map[K]V) iter.Seq[K] {
  function UniqKeys (line 28) | func UniqKeys[K comparable, V any](in ...map[K]V) iter.Seq[K] {
  function Values (line 51) | func Values[K comparable, V any](in ...map[K]V) iter.Seq[V] {
  function UniqValues (line 67) | func UniqValues[K, V comparable](in ...map[K]V) iter.Seq[V] {
  function Entries (line 90) | func Entries[K comparable, V any](in ...map[K]V) iter.Seq2[K, V] {
  function ToPairs (line 105) | func ToPairs[K comparable, V any](in ...map[K]V) iter.Seq2[K, V] {
  function FromEntries (line 111) | func FromEntries[K comparable, V any](entries ...iter.Seq2[K, V]) map[K]V {
  function FromPairs (line 122) | func FromPairs[K comparable, V any](entries ...iter.Seq2[K, V]) map[K]V {
  function Invert (line 128) | func Invert[K, V comparable](in iter.Seq2[K, V]) iter.Seq2[V, K] {
  function Assign (line 140) | func Assign[K comparable, V any, Map ~map[K]V](maps ...iter.Seq[Map]) Map {
  function ChunkEntries (line 157) | func ChunkEntries[K comparable, V any](m map[K]V, size int) iter.Seq[map...
  function MapToSeq (line 184) | func MapToSeq[K comparable, V, R any](in map[K]V, transform func(key K, ...
  function FilterMapToSeq (line 199) | func FilterMapToSeq[K comparable, V, R any](in map[K]V, transform func(k...
  function FilterKeys (line 212) | func FilterKeys[K comparable, V any](in map[K]V, predicate func(key K, v...
  function FilterValues (line 225) | func FilterValues[K comparable, V any](in map[K]V, predicate func(key K,...
  function SeqToSeq2 (line 237) | func SeqToSeq2[T any](in iter.Seq[T]) iter.Seq2[int, T] {
  function Seq2KeyToSeq (line 251) | func Seq2KeyToSeq[K, V any](in iter.Seq2[K, V]) iter.Seq[K] {
  function Seq2ValueToSeq (line 263) | func Seq2ValueToSeq[K, V any](in iter.Seq2[K, V]) iter.Seq[V] {

FILE: it/map_example_test.go
  function ExampleKeys (line 12) | func ExampleKeys() {
  function ExampleUniqKeys (line 22) | func ExampleUniqKeys() {
  function ExampleValues (line 32) | func ExampleValues() {
  function ExampleUniqValues (line 43) | func ExampleUniqValues() {
  function ExampleEntries (line 54) | func ExampleEntries() {
  function ExampleFromEntries (line 63) | func ExampleFromEntries() {
  function ExampleInvert (line 74) | func ExampleInvert() {
  function ExampleAssign (line 83) | func ExampleAssign() {
  function ExampleChunkEntries (line 93) | func ExampleChunkEntries() {
  function ExampleMapToSeq (line 113) | func ExampleMapToSeq() {
  function ExampleFilterMapToSeq (line 125) | func ExampleFilterMapToSeq() {
  function ExampleFilterKeys (line 137) | func ExampleFilterKeys() {
  function ExampleFilterValues (line 148) | func ExampleFilterValues() {
  function ExampleSeqToSeq2 (line 159) | func ExampleSeqToSeq2() {
  function ExampleSeq2KeyToSeq (line 166) | func ExampleSeq2KeyToSeq() {
  function ExampleSeq2ValueToSeq (line 178) | func ExampleSeq2ValueToSeq() {

FILE: it/map_test.go
  function TestKeys (line 15) | func TestKeys(t *testing.T) {
  function TestUniqKeys (line 35) | func TestUniqKeys(t *testing.T) {
  function TestValues (line 59) | func TestValues(t *testing.T) {
  function TestUniqValues (line 79) | func TestUniqValues(t *testing.T) {
  function TestEntries (line 106) | func TestEntries(t *testing.T) {
  function TestToPairs (line 114) | func TestToPairs(t *testing.T) {
  function TestFromEntries (line 122) | func TestFromEntries(t *testing.T) {
  function TestFromPairs (line 133) | func TestFromPairs(t *testing.T) {
  function TestInvert (line 144) | func TestInvert(t *testing.T) {
  function TestAssign (line 155) | func TestAssign(t *testing.T) {
  function TestChunkEntries (line 168) | func TestChunkEntries(t *testing.T) {
  function TestMapToSeq (line 208) | func TestMapToSeq(t *testing.T) {
  function TestFilterMapToSeq (line 223) | func TestFilterMapToSeq(t *testing.T) {
  function TestFilterKeys (line 238) | func TestFilterKeys(t *testing.T) {
  function TestFilterValues (line 253) | func TestFilterValues(t *testing.T) {
  function TestSeqToSeq2 (line 268) | func TestSeqToSeq2(t *testing.T) {
  function TestSeq2KeyToSeq (line 279) | func TestSeq2KeyToSeq(t *testing.T) {
  function TestSeq2ValueToSeq (line 290) | func TestSeq2ValueToSeq(t *testing.T) {
  function BenchmarkAssign (line 301) | func BenchmarkAssign(b *testing.B) {

FILE: it/math.go
  function Range (line 14) | func Range(elementNum int) iter.Seq[int] {
  function RangeFrom (line 28) | func RangeFrom[T constraints.Integer | constraints.Float](start T, eleme...
  function RangeWithSteps (line 43) | func RangeWithSteps[T constraints.Integer | constraints.Float](start, en...
  function Sum (line 72) | func Sum[T constraints.Float | constraints.Integer | constraints.Complex...
  function SumBy (line 79) | func SumBy[T any, R constraints.Float | constraints.Integer | constraint...
  function Product (line 90) | func Product[T constraints.Float | constraints.Integer | constraints.Com...
  function ProductBy (line 97) | func ProductBy[T any, R constraints.Float | constraints.Integer | constr...
  function Mean (line 108) | func Mean[T constraints.Float | constraints.Integer](collection iter.Seq...
  function MeanBy (line 115) | func MeanBy[T any, R constraints.Float | constraints.Integer](collection...
  function Mode (line 134) | func Mode[T constraints.Integer | constraints.Float](collection iter.Seq...

FILE: it/math_example_test.go
  function ExampleRange (line 10) | func ExampleRange() {
  function ExampleSum (line 39) | func ExampleSum() {
  function ExampleSumBy (line 48) | func ExampleSumBy() {
  function ExampleProduct (line 59) | func ExampleProduct() {
  function ExampleProductBy (line 68) | func ExampleProductBy() {
  function ExampleMean (line 79) | func ExampleMean() {
  function ExampleMeanBy (line 88) | func ExampleMeanBy() {

FILE: it/math_test.go
  function TestRange (line 12) | func TestRange(t *testing.T) {
  function TestRangeFrom (line 24) | func TestRangeFrom(t *testing.T) {
  function TestRangeWithSteps (line 44) | func TestRangeWithSteps(t *testing.T) {
  function TestSum (line 73) | func TestSum(t *testing.T) {
  function TestSumBy (line 90) | func TestSumBy(t *testing.T) {
  function TestProduct (line 107) | func TestProduct(t *testing.T) {
  function TestProductBy (line 128) | func TestProductBy(t *testing.T) {
  function TestMean (line 149) | func TestMean(t *testing.T) {
  function TestMeanBy (line 164) | func TestMeanBy(t *testing.T) {
  function TestMode (line 179) | func TestMode(t *testing.T) {
  function TestModeCapacityConsistency (line 196) | func TestModeCapacityConsistency(t *testing.T) {

FILE: it/seq.go
  function Length (line 16) | func Length[T any](collection iter.Seq[T]) int {
  function Drain (line 27) | func Drain[T any](collection iter.Seq[T]) {
  function Filter (line 34) | func Filter[T any, I ~func(func(T) bool)](collection I, predicate func(i...
  function FilterI (line 40) | func FilterI[T any, I ~func(func(T) bool)](collection I, predicate func(...
  function Map (line 54) | func Map[T, R any](collection iter.Seq[T], transform func(item T) R) ite...
  function MapI (line 60) | func MapI[T, R any](collection iter.Seq[T], transform func(item T, index...
  function UniqMap (line 76) | func UniqMap[T any, R comparable](collection iter.Seq[T], transform func...
  function UniqMapI (line 84) | func UniqMapI[T any, R comparable](collection iter.Seq[T], transform fun...
  function FilterMap (line 94) | func FilterMap[T, R any](collection iter.Seq[T], callback func(item T) (...
  function FilterMapI (line 104) | func FilterMapI[T, R any](collection iter.Seq[T], callback func(item T, ...
  function FlatMap (line 120) | func FlatMap[T, R any](collection iter.Seq[T], transform func(item T) it...
  function FlatMapI (line 128) | func FlatMapI[T, R any](collection iter.Seq[T], transform func(item T, i...
  function Reduce (line 146) | func Reduce[T, R any](collection iter.Seq[T], accumulator func(agg R, it...
  function ReduceI (line 154) | func ReduceI[T, R any](collection iter.Seq[T], accumulator func(agg R, i...
  function ReduceLast (line 168) | func ReduceLast[T, R any](collection iter.Seq[T], accumulator func(agg R...
  function ReduceLastI (line 176) | func ReduceLastI[T, R any](collection iter.Seq[T], accumulator func(agg ...
  function ForEach (line 183) | func ForEach[T any](collection iter.Seq[T], callback func(item T)) {
  function ForEachI (line 190) | func ForEachI[T any](collection iter.Seq[T], callback func(item T, index...
  function ForEachWhile (line 202) | func ForEachWhile[T any](collection iter.Seq[T], predicate func(item T) ...
  function ForEachWhileI (line 210) | func ForEachWhileI[T any](collection iter.Seq[T], predicate func(item T,...
  function Times (line 223) | func Times[T any](count int, callback func(index int) T) iter.Seq[T] {
  function Uniq (line 238) | func Uniq[T comparable, I ~func(func(T) bool)](collection I) I {
  function UniqBy (line 248) | func UniqBy[T any, U comparable, I ~func(func(T) bool)](collection I, tr...
  function GroupBy (line 268) | func GroupBy[T any, U comparable](collection iter.Seq[T], transform func...
  function GroupByMap (line 275) | func GroupByMap[T any, K comparable, V any](collection iter.Seq[T], tran...
  function Chunk (line 290) | func Chunk[T any](collection iter.Seq[T], size int) iter.Seq[[]T] {
  function Window (line 319) | func Window[T any](collection iter.Seq[T], size int) iter.Seq[[]T] {
  function Sliding (line 332) | func Sliding[T any](collection iter.Seq[T], size, step int) iter.Seq[[]T] {
  function PartitionBy (line 396) | func PartitionBy[T any, K comparable](collection iter.Seq[T], transform ...
  function Flatten (line 417) | func Flatten[T any, I ~func(func(T) bool)](collection []I) I {
  function Concat (line 431) | func Concat[T any, I ~func(func(T) bool)](collection ...I) I {
  function Interleave (line 438) | func Interleave[T any](collections ...iter.Seq[T]) iter.Seq[T] {
  function Shuffle (line 467) | func Shuffle[T any, I ~func(func(T) bool)](collection I) I {
  function Reverse (line 477) | func Reverse[T any, I ~func(func(T) bool)](collection I) I {
  function Fill (line 491) | func Fill[T lo.Clonable[T], I ~func(func(T) bool)](collection I, initial...
  function Repeat (line 503) | func Repeat[T lo.Clonable[T]](count int, initial T) iter.Seq[T] {
  function RepeatBy (line 509) | func RepeatBy[T any](count int, callback func(index int) T) iter.Seq[T] {
  function KeyBy (line 522) | func KeyBy[K comparable, V any](collection iter.Seq[V], transform func(i...
  function Associate (line 538) | func Associate[T any, K comparable, V any](collection iter.Seq[T], trans...
  function AssociateI (line 547) | func AssociateI[T any, K comparable, V any](collection iter.Seq[T], tran...
  function SeqToMap (line 566) | func SeqToMap[T any, K comparable, V any](collection iter.Seq[T], transf...
  function SeqToMapI (line 576) | func SeqToMapI[T any, K comparable, V any](collection iter.Seq[T], trans...
  function FilterSeqToMap (line 586) | func FilterSeqToMap[T any, K comparable, V any](collection iter.Seq[T], ...
  function FilterSeqToMapI (line 598) | func FilterSeqToMapI[T any, K comparable, V any](collection iter.Seq[T],...
  function Keyify (line 615) | func Keyify[T comparable](collection iter.Seq[T]) map[T]struct{} {
  function Drop (line 627) | func Drop[T any, I ~func(func(T) bool)](collection I, n int) I {
  function DropLast (line 642) | func DropLast[T any, I ~func(func(T) bool)](collection I, n int) I {
  function DropWhile (line 670) | func DropWhile[T any, I ~func(func(T) bool)](collection I, predicate fun...
  function DropLastWhile (line 686) | func DropLastWhile[T any, I ~func(func(T) bool)](collection I, predicate...
  function Take (line 710) | func Take[T any, I ~func(func(T) bool)](collection I, n int) I {
  function TakeWhile (line 731) | func TakeWhile[T any, I ~func(func(T) bool)](collection I, predicate fun...
  function DropByIndex (line 744) | func DropByIndex[T any, I ~func(func(T) bool)](collection I, indexes ......
  function TakeFilter (line 752) | func TakeFilter[T any, I ~func(func(T) bool)](collection I, n int, predi...
  function TakeFilterI (line 758) | func TakeFilterI[T any, I ~func(func(T) bool)](collection I, n int, pred...
  function Reject (line 784) | func Reject[T any, I ~func(func(T) bool)](collection I, predicate func(i...
  function RejectI (line 790) | func RejectI[T any, I ~func(func(T) bool)](collection I, predicate func(...
  function RejectMap (line 808) | func RejectMap[T, R any](collection iter.Seq[T], callback func(item T) (...
  function RejectMapI (line 818) | func RejectMapI[T, R any](collection iter.Seq[T], callback func(item T, ...
  function Count (line 833) | func Count[T comparable](collection iter.Seq[T], value T) int {
  function CountBy (line 840) | func CountBy[T any](collection iter.Seq[T], predicate func(item T) bool)...
  function CountValues (line 855) | func CountValues[T comparable](collection iter.Seq[T]) map[T]int {
  function CountValuesBy (line 863) | func CountValuesBy[T any, U comparable](collection iter.Seq[T], transfor...
  function Subset (line 876) | func Subset[T any, I ~func(func(T) bool)](collection I, offset, length i...
  function Slice (line 890) | func Slice[T any, I ~func(func(T) bool)](collection I, start, end int) I {
  function Replace (line 911) | func Replace[T comparable, I ~func(func(T) bool)](collection I, old, nEw...
  function ReplaceAll (line 926) | func ReplaceAll[T comparable, I ~func(func(T) bool)](collection I, old, ...
  function Compact (line 932) | func Compact[T comparable, I ~func(func(T) bool)](collection I) I {
  function IsSorted (line 939) | func IsSorted[T constraints.Ordered](collection iter.Seq[T]) bool {
  function IsSortedBy (line 946) | func IsSortedBy[T any, K constraints.Ordered](collection iter.Seq[T], tr...
  function Splice (line 963) | func Splice[T any, I ~func(func(T) bool)](collection I, index int, eleme...
  function CutPrefix (line 1003) | func CutPrefix[T comparable, I ~func(func(T) bool)](collection I, separa...
  function CutSuffix (line 1058) | func CutSuffix[T comparable, I ~func(func(T) bool)](collection I, separa...
  function Trim (line 1067) | func Trim[T comparable, I ~func(func(T) bool)](collection I, cutset ...T...
  function TrimFirst (line 1075) | func TrimFirst[T comparable, I ~func(func(T) bool)](collection I, cutset...
  function TrimPrefix (line 1081) | func TrimPrefix[T comparable, I ~func(func(T) bool)](collection I, prefi...
  function TrimLast (line 1120) | func TrimLast[T comparable, I ~func(func(T) bool)](collection I, cutset ...
  function TrimSuffix (line 1126) | func TrimSuffix[T comparable, I ~func(func(T) bool)](collection I, suffi...
  function Buffer (line 1169) | func Buffer[T any](seq iter.Seq[T], size int) iter.Seq[[]T] {

FILE: it/seq_example_test.go
  function ExampleLength (line 13) | func ExampleLength() {
  function ExampleDrain (line 22) | func ExampleDrain() {
  function ExampleFilter (line 28) | func ExampleFilter() {
  function ExampleMap (line 39) | func ExampleMap() {
  function ExampleUniqMap (line 50) | func ExampleUniqMap() {
  function ExampleFilterMap (line 65) | func ExampleFilterMap() {
  function ExampleFlatMap (line 76) | func ExampleFlatMap() {
  function ExampleReduce (line 90) | func ExampleReduce() {
  function ExampleReduceLast (line 101) | func ExampleReduceLast() {
  function ExampleForEach (line 112) | func ExampleForEach() {
  function ExampleForEachWhile (line 126) | func ExampleForEachWhile() {
  function ExampleTimes (line 142) | func ExampleTimes() {
  function ExampleUniq (line 151) | func ExampleUniq() {
  function ExampleUniqBy (line 160) | func ExampleUniqBy() {
  function ExampleGroupBy (line 171) | func ExampleGroupBy() {
  function ExampleGroupByMap (line 187) | func ExampleGroupByMap() {
  function ExampleChunk (line 203) | func ExampleChunk() {
  function ExampleWindow (line 217) | func ExampleWindow() {
  function ExampleSliding (line 231) | func ExampleSliding() {
  function ExamplePartitionBy (line 245) | func ExamplePartitionBy() {
  function ExampleFlatten (line 266) | func ExampleFlatten() {
  function ExampleConcat (line 275) | func ExampleConcat() {
  function ExampleInterleave (line 286) | func ExampleInterleave() {
  function ExampleShuffle (line 300) | func ExampleShuffle() {
  function ExampleReverse (line 308) | func ExampleReverse() {
  function ExampleFill (line 317) | func ExampleFill() {
  function ExampleRepeat (line 326) | func ExampleRepeat() {
  function ExampleRepeatBy (line 333) | func ExampleRepeatBy() {
  function ExampleKeyBy (line 342) | func ExampleKeyBy() {
  function ExampleSeqToMap (line 353) | func ExampleSeqToMap() {
  function ExampleFilterSeqToMap (line 364) | func ExampleFilterSeqToMap() {
  function ExampleKeyify (line 375) | func ExampleKeyify() {
  function ExampleDrop (line 391) | func ExampleDrop() {
  function ExampleTake (line 400) | func ExampleTake() {
  function ExampleDropWhile (line 409) | func ExampleDropWhile() {
  function ExampleTakeWhile (line 420) | func ExampleTakeWhile() {
  function ExampleDropByIndex (line 431) | func ExampleDropByIndex() {
  function ExampleTakeFilter (line 440) | func ExampleTakeFilter() {
  function ExampleTakeFilterI (line 451) | func ExampleTakeFilterI() {
  function ExampleReject (line 462) | func ExampleReject() {
  function ExampleCount (line 473) | func ExampleCount() {
  function ExampleCountBy (line 482) | func ExampleCountBy() {
  function ExampleCountValues (line 493) | func ExampleCountValues() {
  function ExampleCountValuesBy (line 513) | func ExampleCountValuesBy() {
  function ExampleSubset (line 542) | func ExampleSubset() {
  function ExampleSlice (line 551) | func ExampleSlice() {
  function ExampleReplace (line 569) | func ExampleReplace() {
  function ExampleCompact (line 591) | func ExampleCompact() {
  function ExampleIsSorted (line 601) | func ExampleIsSorted() {
  function ExampleIsSortedBy (line 611) | func ExampleIsSortedBy() {
  function ExampleCutPrefix (line 623) | func ExampleCutPrefix() {
  function ExampleCutSuffix (line 644) | func ExampleCutSuffix() {
  function ExampleTrim (line 665) | func ExampleTrim() {
  function ExampleTrimFirst (line 687) | func ExampleTrimFirst() {
  function ExampleTrimPrefix (line 709) | func ExampleTrimPrefix() {
  function ExampleTrimLast (line 731) | func ExampleTrimLast() {
  function ExampleTrimSuffix (line 753) | func ExampleTrimSuffix() {

FILE: it/seq_test.go
  function TestLength (line 17) | func TestLength(t *testing.T) {
  function TestDrain (line 28) | func TestDrain(t *testing.T) {
  function TestFilter (line 44) | func TestFilter(t *testing.T) {
  function TestFilterI (line 66) | func TestFilterI(t *testing.T) {
  function TestMap (line 88) | func TestMap(t *testing.T) {
  function TestMapI (line 103) | func TestMapI(t *testing.T) {
  function TestUniqMap (line 118) | func TestUniqMap(t *testing.T) {
  function TestUniqMapI (line 135) | func TestUniqMapI(t *testing.T) {
  function TestFilterMap (line 152) | func TestFilterMap(t *testing.T) {
  function TestFilterMapI (line 173) | func TestFilterMapI(t *testing.T) {
  function TestFlatMap (line 194) | func TestFlatMap(t *testing.T) {
  function TestFlatMapI (line 215) | func TestFlatMapI(t *testing.T) {
  function TestTimes (line 236) | func TestTimes(t *testing.T) {
  function TestReduce (line 246) | func TestReduce(t *testing.T) {
  function TestReduceI (line 261) | func TestReduceI(t *testing.T) {
  function TestReduceLast (line 276) | func TestReduceLast(t *testing.T) {
  function TestReduceLastI (line 291) | func TestReduceLastI(t *testing.T) {
  function TestForEachI (line 306) | func TestForEachI(t *testing.T) {
  function TestForEachWhileI (line 325) | func TestForEachWhileI(t *testing.T) {
  function TestUniq (line 348) | func TestUniq(t *testing.T) {
  function TestUniqBy (line 361) | func TestUniqBy(t *testing.T) {
  function TestGroupBy (line 378) | func TestGroupBy(t *testing.T) {
  function TestGroupByMap (line 392) | func TestGroupByMap(t *testing.T) {
  function TestChunk (line 436) | func TestChunk(t *testing.T) {
  function TestWindow (line 454) | func TestWindow(t *testing.T) {
  function TestSliding (line 479) | func TestSliding(t *testing.T) {
  function TestPartitionBy (line 651) | func TestPartitionBy(t *testing.T) {
  function TestFlatten (line 671) | func TestFlatten(t *testing.T) {
  function TestConcat (line 685) | func TestConcat(t *testing.T) {
  function TestInterleave (line 698) | func TestInterleave(t *testing.T) {
  function TestShuffle (line 741) | func TestShuffle(t *testing.T) {
  function TestReverse (line 759) | func TestReverse(t *testing.T) {
  function TestFill (line 777) | func TestFill(t *testing.T) {
  function TestRepeat (line 788) | func TestRepeat(t *testing.T) {
  function TestRepeatBy (line 799) | func TestRepeatBy(t *testing.T) {
  function TestKeyBy (line 816) | func TestKeyBy(t *testing.T) {
  function TestAssociate (line 827) | func TestAssociate(t *testing.T) {
  function TestAssociateI (line 863) | func TestAssociateI(t *testing.T) {
  function TestSeqToMap (line 895) | func TestSeqToMap(t *testing.T) {
  function TestSeqToMapI (line 931) | func TestSeqToMapI(t *testing.T) {
  function TestFilterSeqToMap (line 963) | func TestFilterSeqToMap(t *testing.T) {
  function TestFilterSeqToMapI (line 999) | func TestFilterSeqToMapI(t *testing.T) {
  function TestKeyify (line 1031) | func TestKeyify(t *testing.T) {
  function TestDrop (line 1043) | func TestDrop(t *testing.T) {
  function TestDropLast (line 1065) | func TestDropLast(t *testing.T) {
  function TestDropWhile (line 1087) | func TestDropWhile(t *testing.T) {
  function TestDropLastWhile (line 1111) | func TestDropLastWhile(t *testing.T) {
  function TestTake (line 1139) | func TestTake(t *testing.T) {
  function TestTakeWhile (line 1160) | func TestTakeWhile(t *testing.T) {
  function TestTakeFilter (line 1188) | func TestTakeFilter(t *testing.T) {
  function TestTakeFilterI (line 1216) | func TestTakeFilterI(t *testing.T) {
  function TestDropByIndex (line 1245) | func TestDropByIndex(t *testing.T) {
  function TestReject (line 1268) | func TestReject(t *testing.T) {
  function TestRejectI (line 1292) | func TestRejectI(t *testing.T) {
  function TestRejectMap (line 1316) | func TestRejectMap(t *testing.T) {
  function TestRejectMapI (line 1337) | func TestRejectMapI(t *testing.T) {
  function TestCount (line 1358) | func TestCount(t *testing.T) {
  function TestCountBy (line 1371) | func TestCountBy(t *testing.T) {
  function TestCountValues (line 1390) | func TestCountValues(t *testing.T) {
  function TestCountValuesBy (line 1401) | func TestCountValuesBy(t *testing.T) {
  function TestSubset (line 1425) | func TestSubset(t *testing.T) {
  function TestSlice (line 1455) | func TestSlice(t *testing.T) {
  function TestReplace (line 1499) | func TestReplace(t *testing.T) {
  function TestReplaceAll (line 1534) | func TestReplaceAll(t *testing.T) {
  function TestCompact (line 1552) | func TestCompact(t *testing.T) {
  function TestIsSorted (line 1599) | func TestIsSorted(t *testing.T) {
  function TestIsSortedBy (line 1610) | func TestIsSortedBy(t *testing.T) {
  function TestSplice (line 1628) | func TestSplice(t *testing.T) {
  function TestCutPrefix (line 1657) | func TestCutPrefix(t *testing.T) {
  function TestCutSuffix (line 1690) | func TestCutSuffix(t *testing.T) {
  function TestTrim (line 1715) | func TestTrim(t *testing.T) {
  function TestTrimFirst (line 1731) | func TestTrimFirst(t *testing.T) {
  function TestTrimPrefix (line 1749) | func TestTrimPrefix(t *testing.T) {
  function TestTrimLast (line 1767) | func TestTrimLast(t *testing.T) {
  function TestTrimSuffix (line 1783) | func TestTrimSuffix(t *testing.T) {
  function TestBuffer (line 1803) | func TestBuffer(t *testing.T) {

FILE: it/string.go
  function ChunkString (line 13) | func ChunkString[T ~string](str T, size int) iter.Seq[T] {

FILE: it/string_example_test.go
  function ExampleChunkString (line 10) | func ExampleChunkString() {

FILE: it/string_test.go
  function TestChunkString (line 12) | func TestChunkString(t *testing.T) {

FILE: it/tuples.go
  function Zip2 (line 15) | func Zip2[A, B any](a iter.Seq[A], b iter.Seq[B]) iter.Seq[lo.Tuple2[A, ...
  function Zip3 (line 38) | func Zip3[A, B, C any](a iter.Seq[A], b iter.Seq[B], c iter.Seq[C]) iter...
  function Zip4 (line 64) | func Zip4[A, B, C, D any](a iter.Seq[A], b iter.Seq[B], c iter.Seq[C], d...
  function Zip5 (line 93) | func Zip5[A, B, C, D, E any](a iter.Seq[A], b iter.Seq[B], c iter.Seq[C]...
  function Zip6 (line 125) | func Zip6[A, B, C, D, E, F any](a iter.Seq[A], b iter.Seq[B], c iter.Seq...
  function Zip7 (line 160) | func Zip7[A, B, C, D, E, F, G any](a iter.Seq[A], b iter.Seq[B], c iter....
  function Zip8 (line 198) | func Zip8[A, B, C, D, E, F, G, H any](a iter.Seq[A], b iter.Seq[B], c it...
  function Zip9 (line 239) | func Zip9[A, B, C, D, E, F, G, H, I any](a iter.Seq[A], b iter.Seq[B], c...
  function ZipBy2 (line 283) | func ZipBy2[A, B, Out any](a iter.Seq[A], b iter.Seq[B], transform func(...
  function ZipBy3 (line 293) | func ZipBy3[A, B, C, Out any](a iter.Seq[A], b iter.Seq[B], c iter.Seq[C...
  function ZipBy4 (line 303) | func ZipBy4[A, B, C, D, Out any](a iter.Seq[A], b iter.Seq[B], c iter.Se...
  function ZipBy5 (line 313) | func ZipBy5[A, B, C, D, E, Out any](a iter.Seq[A], b iter.Seq[B], c iter...
  function ZipBy6 (line 323) | func ZipBy6[A, B, C, D, E, F, Out any](a iter.Seq[A], b iter.Seq[B], c i...
  function ZipBy7 (line 333) | func ZipBy7[A, B, C, D, E, F, G, Out any](a iter.Seq[A], b iter.Seq[B], ...
  function ZipBy8 (line 343) | func ZipBy8[A, B, C, D, E, F, G, H, Out any](a iter.Seq[A], b iter.Seq[B...
  function ZipBy9 (line 353) | func ZipBy9[A, B, C, D, E, F, G, H, I, Out any](a iter.Seq[A], b iter.Se...
  function CrossJoin2 (line 363) | func CrossJoin2[A, B any](listA iter.Seq[A], listB iter.Seq[B]) iter.Seq...
  function CrossJoin3 (line 371) | func CrossJoin3[A, B, C any](listA iter.Seq[A], listB iter.Seq[B], listC...
  function CrossJoin4 (line 379) | func CrossJoin4[A, B, C, D any](listA iter.Seq[A], listB iter.Seq[B], li...
  function CrossJoin5 (line 387) | func CrossJoin5[A, B, C, D, E any](listA iter.Seq[A], listB iter.Seq[B],...
  function CrossJoin6 (line 395) | func CrossJoin6[A, B, C, D, E, F any](listA iter.Seq[A], listB iter.Seq[...
  function CrossJoin7 (line 403) | func CrossJoin7[A, B, C, D, E, F, G any](listA iter.Seq[A], listB iter.S...
  function CrossJoin8 (line 411) | func CrossJoin8[A, B, C, D, E, F, G, H any](listA iter.Seq[A], listB ite...
  function CrossJoin9 (line 419) | func CrossJoin9[A, B, C, D, E, F, G, H, I any](listA iter.Seq[A], listB ...
  function CrossJoinBy2 (line 428) | func CrossJoinBy2[A, B, Out any](listA iter.Seq[A], listB iter.Seq[B], t...
  function CrossJoinBy3 (line 445) | func CrossJoinBy3[A, B, C, Out any](listA iter.Seq[A], listB iter.Seq[B]...
  function CrossJoinBy4 (line 464) | func CrossJoinBy4[A, B, C, D, Out any](listA iter.Seq[A], listB iter.Seq...
  function CrossJoinBy5 (line 485) | func CrossJoinBy5[A, B, C, D, E, Out any](listA iter.Seq[A], listB iter....
  function CrossJoinBy6 (line 508) | func CrossJoinBy6[A, B, C, D, E, F, Out any](listA iter.Seq[A], listB it...
  function CrossJoinBy7 (line 533) | func CrossJoinBy7[A, B, C, D, E, F, G, Out any](listA iter.Seq[A], listB...
  function CrossJoinBy8 (line 560) | func CrossJoinBy8[A, B, C, D, E, F, G, H, Out any](listA iter.Seq[A], li...
  function CrossJoinBy9 (line 589) | func CrossJoinBy9[A, B, C, D, E, F, G, H, I, Out any](listA iter.Seq[A],...

FILE: it/tuples_example_test.go
  function ExampleZip2 (line 10) | func ExampleZip2() {
  function ExampleZip3 (line 16) | func ExampleZip3() {
  function ExampleZip4 (line 22) | func ExampleZip4() {
  function ExampleZip5 (line 28) | func ExampleZip5() {
  function ExampleZip6 (line 34) | func ExampleZip6() {
  function ExampleZip7 (line 40) | func ExampleZip7() {
  function ExampleZip8 (line 46) | func ExampleZip8() {
  function ExampleZip9 (line 52) | func ExampleZip9() {
  function ExampleCrossJoin2 (line 58) | func ExampleCrossJoin2() {
  function ExampleCrossJoin3 (line 74) | func ExampleCrossJoin3() {
  function ExampleCrossJoin4 (line 98) | func ExampleCrossJoin4() {
  function ExampleCrossJoin5 (line 122) | func ExampleCrossJoin5() {
  function ExampleCrossJoin6 (line 146) | func ExampleCrossJoin6() {
  function ExampleCrossJoin7 (line 170) | func ExampleCrossJoin7() {
  function ExampleCrossJoin8 (line 194) | func ExampleCrossJoin8() {
  function ExampleCrossJoin9 (line 218) | func ExampleCrossJoin9() {
  function ExampleCrossJoinBy2 (line 242) | func ExampleCrossJoinBy2() {
  function ExampleCrossJoinBy3 (line 260) | func ExampleCrossJoinBy3() {
  function ExampleCrossJoinBy4 (line 286) | func ExampleCrossJoinBy4() {
  function ExampleCrossJoinBy5 (line 312) | func ExampleCrossJoinBy5() {
  function ExampleCrossJoinBy6 (line 338) | func ExampleCrossJoinBy6() {
  function ExampleCrossJoinBy7 (line 364) | func ExampleCrossJoinBy7() {
  function ExampleCrossJoinBy8 (line 390) | func ExampleCrossJoinBy8() {
  function ExampleCrossJoinBy9 (line 416) | func ExampleCrossJoinBy9() {

FILE: it/tuples_test.go
  function TestZip (line 14) | func TestZip(t *testing.T) {
  function TestZipBy (line 164) | func TestZipBy(t *testing.T) {
  function TestCrossJoin (line 322) | func TestCrossJoin(t *testing.T) {
  function TestCrossJoinBy (line 353) | func TestCrossJoinBy(t *testing.T) {

FILE: it/type_manipulation.go
  function ToSeqPtr (line 13) | func ToSeqPtr[T any](collection iter.Seq[T]) iter.Seq[*T] {
  function FromSeqPtr (line 20) | func FromSeqPtr[T any](collection iter.Seq[*T]) iter.Seq[T] {
  function FromSeqPtrOr (line 26) | func FromSeqPtrOr[T any](collection iter.Seq[*T], fallback T) iter.Seq[T] {
  function ToAnySeq (line 32) | func ToAnySeq[T any](collection iter.Seq[T]) iter.Seq[any] {
  function FromAnySeq (line 39) | func FromAnySeq[T any](collection iter.Seq[any]) iter.Seq[T] {
  function Empty (line 50) | func Empty[T any]() iter.Seq[T] {
  function IsEmpty (line 57) | func IsEmpty[T any](collection iter.Seq[T]) bool {
  function IsNotEmpty (line 67) | func IsNotEmpty[T any](collection iter.Seq[T]) bool {
  function CoalesceSeq (line 74) | func CoalesceSeq[T any](v ...iter.Seq[T]) (iter.Seq[T], bool) {
  function CoalesceSeqOrEmpty (line 86) | func CoalesceSeqOrEmpty[T any](v ...iter.Seq[T]) iter.Seq[T] {

FILE: it/type_manipulation_test.go
  function TestToSeqPtr (line 12) | func TestToSeqPtr(t *testing.T) {
  function TestFromSeqPtr (line 23) | func TestFromSeqPtr(t *testing.T) {
  function TestFromSeqPtrOr (line 34) | func TestFromSeqPtrOr(t *testing.T) {
  function TestToAnySeq (line 45) | func TestToAnySeq(t *testing.T) {
  function TestFromAnySeq (line 58) | func TestFromAnySeq(t *testing.T) {
  function TestEmpty (line 69) | func TestEmpty(t *testing.T) {
  function TestIsEmpty (line 76) | func TestIsEmpty(t *testing.T) {
  function TestIsNotEmpty (line 84) | func TestIsNotEmpty(t *testing.T) {
  function TestCoalesceSeq (line 92) | func TestCoalesceSeq(t *testing.T) {
  function TestCoalesceSeqOrEmpty (line 137) | func TestCoalesceSeqOrEmpty(t *testing.T) {

FILE: lo_example_test.go
  function ExampleTernary (line 13) | func ExampleTernary() {
  function ExampleTernaryF (line 20) | func ExampleTernaryF() {
  function ExampleIf (line 27) | func ExampleIf() {
  function ExampleIfF (line 67) | func ExampleIfF() {
  function Example_ifElse_ElseIf (line 107) | func Example_ifElse_ElseIf() {
  function Example_ifElse_ElseIfF (line 147) | func Example_ifElse_ElseIfF() {
  function Example_ifElse_Else (line 187) | func Example_ifElse_Else() {
  function Example_ifElse_ElseF (line 227) | func Example_ifElse_ElseF() {
  function ExampleSwitch (line 267) | func ExampleSwitch() {
  function Example_switchCase_Case (line 313) | func Example_switchCase_Case() {
  function Example_switchCase_CaseF (line 359) | func Example_switchCase_CaseF() {
  function Example_switchCase_Default (line 405) | func Example_switchCase_Default() {
  function Example_switchCase_DefaultF (line 451) | func Example_switchCase_DefaultF() {
  function ExampleValidate (line 497) | func ExampleValidate() {
  function ExampleMust (line 509) | func ExampleMust() {
  function ExampleMust0 (line 530) | func ExampleMust0() {
  function ExampleMust1 (line 545) | func ExampleMust1() {
  function ExampleMust2 (line 566) | func ExampleMust2() {
  function ExampleMust3 (line 581) | func ExampleMust3() {
  function ExampleMust4 (line 596) | func ExampleMust4() {
  function ExampleMust5 (line 611) | func ExampleMust5() {
  function ExampleMust6 (line 626) | func ExampleMust6() {
  function ExampleTry (line 641) | func ExampleTry() {
  function ExampleTry1 (line 661) | func ExampleTry1() {
  function ExampleTry2 (line 681) | func ExampleTry2() {
  function ExampleTry3 (line 701) | func ExampleTry3() {
  function ExampleTry4 (line 721) | func ExampleTry4() {
  function ExampleTry5 (line 741) | func ExampleTry5() {
  function ExampleTry6 (line 761) | func ExampleTry6() {
  function ExampleTryOr (line 781) | func ExampleTryOr() {
  function ExampleTryOr1 (line 801) | func ExampleTryOr1() {
  function ExampleTryOr2 (line 821) | func ExampleTryOr2() {
  function ExampleTryOr3 (line 830) | func ExampleTryOr3() {
  function ExampleTryOr4 (line 839) | func ExampleTryOr4() {
  function ExampleTryOr5 (line 848) | func ExampleTryOr5() {
  function ExampleTryOr6 (line 857) | func ExampleTryOr6() {
  function ExampleTryWithErrorValue (line 866) | func ExampleTryWithErrorValue() {
  function ExampleTryCatchWithErrorValue (line 886) | func ExampleTryCatchWithErrorValue() {
  type myError (line 899) | type myError struct
    method Error (line 901) | func (e myError) Error() string {
  function ExampleErrorsAs (line 905) | func ExampleErrorsAs() {
  function ExampleAssert (line 921) | func ExampleAssert() {
  function ExampleAssertf (line 945) | func ExampleAssertf() {
  function ExampleIndexOf (line 963) | func ExampleIndexOf() {
  function ExampleIndexOf_notFound (line 972) | func ExampleIndexOf_notFound() {
  function ExampleLastIndexOf (line 981) | func ExampleLastIndexOf() {
  function ExampleLastIndexOf_notFound (line 990) | func ExampleLastIndexOf_notFound() {
  function ExampleFind (line 999) | func ExampleFind() {
  function ExampleFind_notFound (line 1019) | func ExampleFind_notFound() {
  function ExampleFindErr (line 1030) | func ExampleFindErr() {
  function ExampleFindIndexOf (line 1054) | func ExampleFindIndexOf() {
  function ExampleFindIndexOf_notFound (line 1065) | func ExampleFindIndexOf_notFound() {
  function ExampleFindLastIndexOf (line 1076) | func ExampleFindLastIndexOf() {
  function ExampleFindLastIndexOf_notFound (line 1087) | func ExampleFindLastIndexOf_notFound() {
  function ExampleFindOrElse (line 1098) | func ExampleFindOrElse() {
  function ExampleFindOrElse_found (line 1109) | func ExampleFindOrElse_found() {
  function ExampleFindKey (line 1120) | func ExampleFindKey() {
  function ExampleFindKey_notFound (line 1133) | func ExampleFindKey_notFound() {
  function ExampleFindKeyBy (line 1146) | func ExampleFindKeyBy() {
  function ExampleFindKeyBy_notFound (line 1161) | func ExampleFindKeyBy_notFound() {
  function ExampleFindUniques (line 1176) | func ExampleFindUniques() {
  function ExampleFindUniquesBy (line 1185) | func ExampleFindUniquesBy() {
  function ExampleFindDuplicates (line 1207) | func ExampleFindDuplicates() {
  function ExampleFindDuplicatesBy (line 1216) | func ExampleFindDuplicatesBy() {
  function ExampleFindDuplicatesByErr (line 1238) | func ExampleFindDuplicatesByErr() {
  function ExampleMin (line 1263) | func ExampleMin() {
  function ExampleMin_empty (line 1272) | func ExampleMin_empty() {
  function ExampleMinIndex (line 1281) | func ExampleMinIndex() {
  function ExampleMinIndex_empty (line 1290) | func ExampleMinIndex_empty() {
  function ExampleMinBy (line 1299) | func ExampleMinBy() {
  function ExampleMinByErr (line 1319) | func ExampleMinByErr() {
  function ExampleMinIndexBy (line 1342) | func ExampleMinIndexBy() {
  function ExampleMinIndexByErr (line 1362) | func ExampleMinIndexByErr() {
  function ExampleEarliest (line 1385) | func ExampleEarliest() {
  function ExampleEarliestBy (line 1396) | func ExampleEarliestBy() {
  function ExampleEarliestByErr (line 1417) | func ExampleEarliestByErr() {
  function ExampleMax (line 1441) | func ExampleMax() {
  function ExampleMax_empty (line 1450) | func ExampleMax_empty() {
  function ExampleMaxIndex (line 1459) | func ExampleMaxIndex() {
  function ExampleMaxIndex_empty (line 1468) | func ExampleMaxIndex_empty() {
  function ExampleMaxBy (line 1477) | func ExampleMaxBy() {
  function ExampleMaxByErr (line 1497) | func ExampleMaxByErr() {
  function ExampleMaxIndexBy (line 1520) | func ExampleMaxIndexBy() {
  function ExampleMaxIndexByErr (line 1540) | func ExampleMaxIndexByErr() {
  function ExampleLatest (line 1563) | func ExampleLatest() {
  function ExampleLatestBy (line 1574) | func ExampleLatestBy() {
  function ExampleLatestByErr (line 1595) | func ExampleLatestByErr() {
  function ExampleFirst (line 1620) | func ExampleFirst() {
  function ExampleFirst_empty (line 1629) | func ExampleFirst_empty() {
  function ExampleFirstOrEmpty (line 1638) | func ExampleFirstOrEmpty() {
  function ExampleFirstOrEmpty_empty (line 1647) | func ExampleFirstOrEmpty_empty() {
  function ExampleFirstOr (line 1656) | func ExampleFirstOr() {
  function ExampleFirstOr_empty (line 1665) | func ExampleFirstOr_empty() {
  function ExampleLast (line 1674) | func ExampleLast() {
  function ExampleLast_empty (line 1683) | func ExampleLast_empty() {
  function ExampleLastOrEmpty (line 1692) | func ExampleLastOrEmpty() {
  function ExampleLastOrEmpty_empty (line 1701) | func ExampleLastOrEmpty_empty() {
  function ExampleLastOr (line 1710) | func ExampleLastOr() {
  function ExampleLastOr_empty (line 1719) | func ExampleLastOr_empty() {
  function ExampleNth (line 1728) | func ExampleNth() {
  function ExampleNth_negative (line 1737) | func ExampleNth_negative() {
  function ExampleNth_outOfBounds (line 1746) | func ExampleNth_outOfBounds() {
  function ExampleNthOr (line 1755) | func ExampleNthOr() {
  function ExampleNthOr_outOfBounds (line 1764) | func ExampleNthOr_outOfBounds() {
  function ExampleNthOrEmpty (line 1773) | func ExampleNthOrEmpty() {
  function ExampleNthOrEmpty_outOfBounds (line 1782) | func ExampleNthOrEmpty_outOfBounds() {
  function ExampleWithoutBy (line 1791) | func ExampleWithoutBy() {
  function ExampleWithoutByErr (line 1820) | func ExampleWithoutByErr() {
  function ExampleKeys (line 1852) | func ExampleKeys() {
  function ExampleUniqKeys (line 1862) | func ExampleUniqKeys() {
  function ExampleValues (line 1872) | func ExampleValues() {
  function ExampleUniqValues (line 1883) | func ExampleUniqValues() {
  function ExampleValueOr (line 1894) | func ExampleValueOr() {
  function ExamplePickBy (line 1904) | func ExamplePickBy() {
  function ExamplePickByErr (line 1915) | func ExamplePickByErr() {
  function ExamplePickByKeys (line 1929) | func ExamplePickByKeys() {
  function ExamplePickByValues (line 1938) | func ExamplePickByValues() {
  function ExampleOmitBy (line 1947) | func ExampleOmitBy() {
  function ExampleOmitByErr (line 1958) | func ExampleOmitByErr() {
  function ExampleOmitByKeys (line 1972) | func ExampleOmitByKeys() {
  function ExampleOmitByValues (line 1981) | func ExampleOmitByValues() {
  function ExampleEntries (line 1990) | func ExampleEntries() {
  function ExampleFromEntries (line 2002) | func ExampleFromEntries() {
  function ExampleInvert (line 2022) | func ExampleInvert() {
  function ExampleAssign (line 2031) | func ExampleAssign() {
  function ExampleChunkEntries (line 2041) | func ExampleChunkEntries() {
  function ExampleMapKeys (line 2061) | func ExampleMapKeys() {
  function ExampleMapKeysErr (line 2072) | func ExampleMapKeysErr() {
  function ExampleMapValues (line 2086) | func ExampleMapValues() {
  function ExampleMapValuesErr (line 2097) | func ExampleMapValuesErr() {
  function ExampleMapEntries (line 2111) | func ExampleMapEntries() {
  function ExampleMapEntriesErr (line 2122) | func ExampleMapEntriesErr() {
  function ExampleMapToSlice (line 2136) | func ExampleMapToSlice() {
  function ExampleMapToSliceErr (line 2148) | func ExampleMapToSliceErr() {
  function ExampleFilterMapToSlice (line 2162) | func ExampleFilterMapToSlice() {
  function ExampleFilterMapToSliceErr (line 2174) | func ExampleFilterMapToSliceErr() {
  function ExampleFilterKeys (line 2188) | func ExampleFilterKeys() {
  function ExampleFilterValues (line 2199) | func ExampleFilterValues() {
  function ExampleFilterKeysErr (line 2210) | func ExampleFilterKeysErr() {
  function ExampleFilterValuesErr (line 2230) | func ExampleFilterValuesErr() {
  function ExampleRange (line 2250) | func ExampleRange() {
  function ExampleClamp (line 2279) | func ExampleClamp() {
  function ExampleSum (line 2293) | func ExampleSum() {
  function ExampleSumBy (line 2302) | func ExampleSumBy() {
  function ExampleSumByErr (line 2313) | func ExampleSumByErr() {
  function ExampleProduct (line 2327) | func ExampleProduct() {
  function ExampleProductBy (line 2336) | func ExampleProductBy() {
  function ExampleProductByErr (line 2347) | func ExampleProductByErr() {
  function ExampleMean (line 2361) | func ExampleMean() {
  function ExampleMeanBy (line 2370) | func ExampleMeanBy() {
  function ExampleMeanByErr (line 2381) | func ExampleMeanByErr() {
  function ExampleFilter (line 2395) | func ExampleFilter() {
  function ExampleFilterErr (line 2406) | func ExampleFilterErr() {
  function ExampleMap (line 2426) | func ExampleMap() {
  function ExampleMapErr (line 2437) | func ExampleMapErr() {
  function ExampleUniqMap (line 2451) | func ExampleUniqMap() {
  function ExampleFilterMap (line 2468) | func ExampleFilterMap() {
  function ExampleFlatMap (line 2479) | func ExampleFlatMap() {
  function ExampleFlatMapErr (line 2493) | func ExampleFlatMapErr() {
  function ExampleReduce (line 2510) | func ExampleReduce() {
  function ExampleReduceErr (line 2521) | func ExampleReduceErr() {
  function ExampleReduceRight (line 2535) | func ExampleReduceRight() {
  function ExampleReduceRightErr (line 2546) | func ExampleReduceRightErr() {
  function ExampleForEach (line 2560) | func ExampleForEach() {
  function ExampleForEachWhile (line 2574) | func ExampleForEachWhile() {
  function ExampleTimes (line 2590) | func ExampleTimes() {
  function ExampleUniq (line 2599) | func ExampleUniq() {
  function ExampleUniqBy (line 2608) | func ExampleUniqBy() {
  function ExampleUniqByErr (line 2619) | func ExampleUniqByErr() {
  function ExampleGroupBy (line 2633) | func ExampleGroupBy() {
  function ExampleGroupByErr (line 2649) | func ExampleGroupByErr() {
  function ExampleGroupByMap (line 2663) | func ExampleGroupByMap() {
  function ExampleGroupByMapErr (line 2679) | func ExampleGroupByMapErr() {
  function ExampleChunk (line 2693) | func ExampleChunk() {
  function ExampleWindow (line 2707) | func ExampleWindow() {
  function ExampleSliding (line 2721) | func ExampleSliding() {
  function ExamplePartitionBy (line 2742) | func ExamplePartitionBy() {
  function ExamplePartitionByErr (line 2763) | func ExamplePartitionByErr() {
  function ExampleFlatten (line 2782) | func ExampleFlatten() {
  function ExampleConcat (line 2791) | func ExampleConcat() {
  function ExampleInterleave (line 2800) | func ExampleInterleave() {
  function ExampleShuffle (line 2814) | func ExampleShuffle() {
  function ExampleReverse (line 2822) | func ExampleReverse() {
  function ExampleFill (line 2831) | func ExampleFill() {
  function ExampleRepeat (line 2840) | func ExampleRepeat() {
  function ExampleRepeatBy (line 2847) | func ExampleRepeatBy() {
  function ExampleRepeatByErr (line 2856) | func ExampleRepeatByErr() {
  function ExampleKeyBy (line 2868) | func ExampleKeyBy() {
  function ExampleKeyByErr (line 2879) | func ExampleKeyByErr() {
  function ExampleSliceToMap (line 2893) | func ExampleSliceToMap() {
  function ExampleFilterSliceToMap (line 2904) | func ExampleFilterSliceToMap() {
  function ExampleKeyify (line 2915) | func ExampleKeyify() {
  function ExampleDrop (line 2931) | func ExampleDrop() {
  function ExampleDropRight (line 2940) | func ExampleDropRight() {
  function ExampleDropWhile (line 2949) | func ExampleDropWhile() {
  function ExampleDropRightWhile (line 2960) | func ExampleDropRightWhile() {
  function ExampleTake (line 2971) | func ExampleTake() {
  function ExampleTakeWhile (line 2980) | func ExampleTakeWhile() {
  function ExampleTakeFilter (line 2991) | func ExampleTakeFilter() {
  function ExampleDropByIndex (line 3004) | func ExampleDropByIndex() {
  function ExampleReject (line 3013) | func ExampleReject() {
  function ExampleRejectErr (line 3024) | func ExampleRejectErr() {
  function ExampleCount (line 3044) | func ExampleCount() {
  function ExampleCountBy (line 3053) | func ExampleCountBy() {
  function ExampleCountByErr (line 3064) | func ExampleCountByErr() {
  function ExampleCountValues (line 3078) | func ExampleCountValues() {
  function ExampleCountValuesBy (line 3098) | func ExampleCountValuesBy() {
  function ExampleSubset (line 3127) | func ExampleSubset() {
  function ExampleSlice (line 3136) | func ExampleSlice() {
  function ExampleReplace (line 3154) | func ExampleReplace() {
  function ExampleClone (line 3176) | func ExampleClone() {
  function ExampleCompact (line 3186) | func ExampleCompact() {
  function ExampleIsSorted (line 3196) | func ExampleIsSorted() {
  function ExampleIsSortedBy (line 3206) | func ExampleIsSortedBy() {
  function ExampleCut (line 3218) | func ExampleCut() {
  function ExampleCutPrefix (line 3239) | func ExampleCutPrefix() {
  function ExampleCutSuffix (line 3260) | func ExampleCutSuffix() {
  function ExampleTrim (line 3281) | func ExampleTrim() {
  function ExampleTrimLeft (line 3303) | func ExampleTrimLeft() {
  function ExampleTrimPrefix (line 3325) | func ExampleTrimPrefix() {
  function ExampleTrimRight (line 3347) | func ExampleTrimRight() {
  function ExampleTrimSuffix (line 3369) | func ExampleTrimSuffix() {
  function ExampleSubstring (line 3391) | func ExampleSubstring() {
  function ExampleChunkString (line 3411) | func ExampleChunkString() {
  function ExampleRuneLength (line 3428) | func ExampleRuneLength() {
  function ExampleT2 (line 3439) | func ExampleT2() {
  function ExampleT3 (line 3445) | func ExampleT3() {
  function ExampleT4 (line 3451) | func ExampleT4() {
  function ExampleT5 (line 3457) | func ExampleT5() {
  function ExampleT6 (line 3463) | func ExampleT6() {
  function ExampleT7 (line 3469) | func ExampleT7() {
  function ExampleT8 (line 3475) | func ExampleT8() {
  function ExampleT9 (line 3481) | func ExampleT9() {
  function ExampleUnpack2 (line 3487) | func ExampleUnpack2() {
  function ExampleUnpack3 (line 3493) | func ExampleUnpack3() {
  function ExampleUnpack4 (line 3499) | func ExampleUnpack4() {
  function ExampleUnpack5 (line 3505) | func ExampleUnpack5() {
  function ExampleUnpack6 (line 3511) | func ExampleUnpack6() {
  function ExampleUnpack7 (line 3517) | func ExampleUnpack7() {
  function ExampleUnpack8 (line 3523) | func ExampleUnpack8() {
  function ExampleUnpack9 (line 3529) | func ExampleUnpack9() {
  function ExampleZip2 (line 3535) | func ExampleZip2() {
  function ExampleZip3 (line 3541) | func ExampleZip3() {
  function ExampleZip4 (line 3547) | func ExampleZip4() {
  function ExampleZip5 (line 3553) | func ExampleZip5() {
  function ExampleZip6 (line 3559) | func ExampleZip6() {
  function ExampleZip7 (line 3565) | func ExampleZip7() {
  function ExampleZip8 (line 3571) | func ExampleZip8() {
  function ExampleZip9 (line 3577) | func ExampleZip9() {
  function ExampleUnzip2 (line 3583) | func ExampleUnzip2() {
  function ExampleUnzip3 (line 3589) | func ExampleUnzip3() {
  function ExampleUnzip4 (line 3595) | func ExampleUnzip4() {
  function ExampleUnzip5 (line 3601) | func ExampleUnzip5() {
  function ExampleUnzip6 (line 3607) | func ExampleUnzip6() {
  function ExampleUnzip7 (line 3613) | func ExampleUnzip7() {
  function ExampleUnzip8 (line 3619) | func ExampleUnzip8() {
  function ExampleUnzip9 (line 3625) | func ExampleUnzip9() {
  function ExampleUnzipByErr2 (line 3631) | func ExampleUnzipByErr2() {
  function ExampleUnzipByErr3 (line 3642) | func ExampleUnzipByErr3() {
  function ExampleUnzipByErr4 (line 3653) | func ExampleUnzipByErr4() {
  function ExampleUnzipByErr5 (line 3664) | func ExampleUnzipByErr5() {
  function ExampleUnzipByErr6 (line 3675) | func ExampleUnzipByErr6() {
  function ExampleUnzipByErr7 (line 3686) | func ExampleUnzipByErr7() {
  function ExampleUnzipByErr8 (line 3697) | func ExampleUnzipByErr8() {
  function ExampleUnzipByErr9 (line 3708) | func ExampleUnzipByErr9() {
  function ExampleCrossJoin2 (line 3719) | func ExampleCrossJoin2() {
  function ExampleCrossJoin3 (line 3735) | func ExampleCrossJoin3() {
  function ExampleCrossJoin4 (line 3759) | func ExampleCrossJoin4() {
  function ExampleCrossJoin5 (line 3783) | func ExampleCrossJoin5() {
  function ExampleCrossJoin6 (line 3807) | func ExampleCrossJoin6() {
  function ExampleCrossJoin7 (line 3831) | func ExampleCrossJoin7() {
  function ExampleCrossJoin8 (line 3855) | func ExampleCrossJoin8() {
  function ExampleCrossJoin9 (line 3879) | func ExampleCrossJoin9() {
  function ExampleCrossJoinBy2 (line 3903) | func ExampleCrossJoinBy2() {
  function ExampleCrossJoinBy3 (line 3921) | func ExampleCrossJoinBy3() {
  function ExampleCrossJoinBy4 (line 3947) | func ExampleCrossJoinBy4() {
  function ExampleCrossJoinBy5 (line 3973) | func ExampleCrossJoinBy5() {
  function ExampleCrossJoinBy6 (line 3999) | func ExampleCrossJoinBy6() {
  function ExampleCrossJoinBy7 (line 4025) | func ExampleCrossJoinBy7() {
  function ExampleCrossJoinBy8 (line 4051) | func ExampleCrossJoinBy8() {
  function ExampleCrossJoinBy9 (line 4077) | func ExampleCrossJoinBy9() {
  function ExampleCrossJoinByErr2 (line 4103) | func ExampleCrossJoinByErr2() {
  function ExampleZipByErr2 (line 4121) | func ExampleZipByErr2() {
  function ExampleIntersect (line 4139) | func ExampleIntersect() {
  function ExampleIntersectBy (line 4146) | func ExampleIntersectBy() {

FILE: lo_test.go
  function TestMain (line 14) | func TestMain(m *testing.M) {
  function testWithTimeout (line 20) | func testWithTimeout(t *testing.T, timeout time.Duration) {
  type foo (line 56) | type foo struct
    method Clone (line 60) | func (f foo) Clone() foo {

FILE: map.go
  function Keys (line 5) | func Keys[K comparable, V any](in ...map[K]V) []K {
  function UniqKeys (line 23) | func UniqKeys[K comparable, V any](in ...map[K]V) []K {
  function HasKey (line 47) | func HasKey[K comparable, V any](in map[K]V, key K) bool {
  function Values (line 54) | func Values[K comparable, V any](in ...map[K]V) []V {
  function UniqValues (line 72) | func UniqValues[K, V comparable](in ...map[K]V) []V {
  function ValueOr (line 96) | func ValueOr[K comparable, V any](in map[K]V, key K, fallback V) V {
  function PickBy (line 105) | func PickBy[K comparable, V any, Map ~map[K]V](in Map, predicate func(ke...
  function PickByErr (line 117) | func PickByErr[K comparable, V any, Map ~map[K]V](in Map, predicate func...
  function PickByKeys (line 133) | func PickByKeys[K comparable, V any, Map ~map[K]V](in Map, keys []K) Map {
  function PickByValues (line 145) | func PickByValues[K, V comparable, Map ~map[K]V](in Map, values []V) Map {
  function OmitBy (line 159) | func OmitBy[K comparable, V any, Map ~map[K]V](in Map, predicate func(ke...
  function OmitByErr (line 171) | func OmitByErr[K comparable, V any, Map ~map[K]V](in Map, predicate func...
  function OmitByKeys (line 187) | func OmitByKeys[K comparable, V any, Map ~map[K]V](in Map, keys []K) Map {
  function OmitByValues (line 200) | func OmitByValues[K, V comparable, Map ~map[K]V](in Map, values []V) Map {
  function Entries (line 215) | func Entries[K comparable, V any](in map[K]V) []Entry[K, V] {
  function ToPairs (line 231) | func ToPairs[K comparable, V any](in map[K]V) []Entry[K, V] {
  function FromEntries (line 237) | func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V {
  function FromPairs (line 250) | func FromPairs[K comparable, V any](entries []Entry[K, V]) map[K]V {
  function Invert (line 258) | func Invert[K, V comparable](in map[K]V) map[V]K {
  function Assign (line 270) | func Assign[K comparable, V any, Map ~map[K]V](maps ...Map) Map {
  function ChunkEntries (line 289) | func ChunkEntries[K comparable, V any](m map[K]V, size int) []map[K]V {
  function MapKeys (line 314) | func MapKeys[K comparable, V any, R comparable](in map[K]V, iteratee fun...
  function MapKeysErr (line 326) | func MapKeysErr[K comparable, V any, R comparable](in map[K]V, iteratee ...
  function MapValues (line 342) | func MapValues[K comparable, V, R any](in map[K]V, iteratee func(value V...
  function MapValuesErr (line 354) | func MapValuesErr[K comparable, V, R any](in map[K]V, iteratee func(valu...
  function MapEntries (line 370) | func MapEntries[K1 comparable, V1 any, K2 comparable, V2 any](in map[K1]...
  function MapEntriesErr (line 383) | func MapEntriesErr[K1 comparable, V1 any, K2 comparable, V2 any](in map[...
  function MapToSlice (line 399) | func MapToSlice[K comparable, V, R any](in map[K]V, iteratee func(key K,...
  function MapToSliceErr (line 411) | func MapToSliceErr[K comparable, V, R any](in map[K]V, iteratee func(key...
  function FilterMapToSlice (line 430) | func FilterMapToSlice[K comparable, V, R any](in map[K]V, iteratee func(...
  function FilterMapToSliceErr (line 448) | func FilterMapToSliceErr[K comparable, V, R any](in map[K]V, iteratee fu...
  function FilterKeys (line 467) | func FilterKeys[K comparable, V any](in map[K]V, predicate func(key K, v...
  function FilterValues (line 482) | func FilterValues[K comparable, V any](in map[K]V, predicate func(key K,...
  function FilterKeysErr (line 500) | func FilterKeysErr[K comparable, V any](in map[K]V, predicate func(key K...
  function FilterValuesErr (line 522) | func FilterValuesErr[K comparable, V any](in map[K]V, predicate func(key...

FILE: map_test.go
  function TestKeys (line 12) | func TestKeys(t *testing.T) {
  function TestUniqKeys (line 32) | func TestUniqKeys(t *testing.T) {
  function TestHasKey (line 56) | func TestHasKey(t *testing.T) {
  function TestValues (line 67) | func TestValues(t *testing.T) {
  function TestUniqValues (line 87) | func TestUniqValues(t *testing.T) {
  function TestValueOr (line 114) | func TestValueOr(t *testing.T) {
  function TestPickBy (line 125) | func TestPickBy(t *testing.T) {
  function TestPickByErr (line 141) | func TestPickByErr(t *testing.T) {
  function TestPickByKeys (line 241) | func TestPickByKeys(t *testing.T) {
  function TestPickByValues (line 255) | func TestPickByValues(t *testing.T) {
  function TestOmitBy (line 269) | func TestOmitBy(t *testing.T) {
  function TestOmitByErr (line 285) | func TestOmitByErr(t *testing.T) {
  function TestOmitByKeys (line 385) | func TestOmitByKeys(t *testing.T) {
  function TestOmitByValues (line 399) | func TestOmitByValues(t *testing.T) {
  function TestEntries (line 413) | func TestEntries(t *testing.T) {
  function TestToPairs (line 430) | func TestToPairs(t *testing.T) {
  function TestFromEntries (line 447) | func TestFromEntries(t *testing.T) {
  function TestFromPairs (line 467) | func TestFromPairs(t *testing.T) {
  function TestInvert (line 487) | func TestInvert(t *testing.T) {
  function TestAssign (line 498) | func TestAssign(t *testing.T) {
  function TestChunkEntries (line 511) | func TestChunkEntries(t *testing.T) {
  function TestMapKeys (line 551) | func TestMapKeys(t *testing.T) {
  function TestMapKeysErr (line 566) | func TestMapKeysErr(t *testing.T) {
  function TestMapValues (line 610) | func TestMapValues(t *testing.T) {
  function TestMapValuesErr (line 625) | func TestMapValuesErr(t *testing.T) {
  function TestMapEntries (line 706) | func TestMapEntries(t *testing.T) {
  function TestMapEntriesErr (line 829) | func TestMapEntriesErr(t *testing.T) {
  function TestMapToSlice (line 1018) | func TestMapToSlice(t *testing.T) {
  function TestMapToSliceErr (line 1033) | func TestMapToSliceErr(t *testing.T) {
  function TestFilterMapToSlice (line 1109) | func TestFilterMapToSlice(t *testing.T) {
  function TestFilterMapToSliceErr (line 1124) | func TestFilterMapToSliceErr(t *testing.T) {
  function TestFilterKeys (line 1207) | func TestFilterKeys(t *testing.T) {
  function TestFilterValues (line 1222) | func TestFilterValues(t *testing.T) {
  function TestFilterKeysErr (line 1237) | func TestFilterKeysErr(t *testing.T) {
  function TestFilterValuesErr (line 1312) | func TestFilterValuesErr(t *testing.T) {
  function BenchmarkAssign (line 1387) | func BenchmarkAssign(b *testing.B) {

FILE: math.go
  function Range (line 11) | func Range(elementNum int) []int {
  function RangeFrom (line 23) | func RangeFrom[T constraints.Integer | constraints.Float](start T, eleme...
  function RangeWithSteps (line 36) | func RangeWithSteps[T constraints.Integer | constraints.Float](start, en...
  function Clamp (line 71) | func Clamp[T constraints.Ordered](value, mIn, mAx T) T {
  function Sum (line 82) | func Sum[T constraints.Float | constraints.Integer | constraints.Complex...
  function SumBy (line 92) | func SumBy[T any, R constraints.Float | constraints.Integer | constraint...
  function SumByErr (line 103) | func SumByErr[T any, R constraints.Float | constraints.Integer | constra...
  function Product (line 117) | func Product[T constraints.Float | constraints.Integer | constraints.Com...
  function ProductBy (line 127) | func ProductBy[T any, R constraints.Float | constraints.Integer | constr...
  function ProductByErr (line 138) | func ProductByErr[T any, R constraints.Float | constraints.Integer | con...
  function Mean (line 152) | func Mean[T constraints.Float | constraints.Integer](collection []T) T {
  function MeanBy (line 163) | func MeanBy[T any, R constraints.Float | constraints.Integer](collection...
  function MeanByErr (line 175) | func MeanByErr[T any, R constraints.Float | constraints.Integer](collect...
  function Mode (line 191) | func Mode[T constraints.Integer | constraints.Float](collection []T) []T {

FILE: math_test.go
  function TestRange (line 9) | func TestRange(t *testing.T) {
  function TestRangeFrom (line 21) | func TestRangeFrom(t *testing.T) {
  function TestRangeWithSteps (line 41) | func TestRangeWithSteps(t *testing.T) {
  function TestClamp (line 70) | func TestClamp(t *testing.T) {
  function TestSum (line 83) | func TestSum(t *testing.T) {
  function TestSumBy (line 100) | func TestSumBy(t *testing.T) {
  function TestSumByErr (line 117) | func TestSumByErr(t *testing.T) {
  function TestProduct (line 188) | func TestProduct(t *testing.T) {
  function TestProductBy (line 211) | func TestProductBy(t *testing.T) {
  function TestProductByErr (line 235) | func TestProductByErr(t *testing.T) {
  function TestMean (line 366) | func TestMean(t *testing.T) {
  function TestMeanBy (line 381) | func TestMeanBy(t *testing.T) {
  function TestMeanByErr (line 397) | func TestMeanByErr(t *testing.T) {
  function TestMode (line 504) | func TestMode(t *testing.T) {
  function TestModeCapacityConsistency (line 521) | func TestModeCapacityConsistency(t *testing.T) {

FILE: mutable/slice.go
  function Filter (line 11) | func Filter[T any, Slice ~[]T](collection Slice, predicate func(item T) ...
  function FilterI (line 27) | func FilterI[T any, Slice ~[]T](collection Slice, predicate func(item T,...
  function Map (line 41) | func Map[T any, Slice ~[]T](collection Slice, transform func(item T) T) {
  function MapI (line 49) | func MapI[T any, Slice ~[]T](collection Slice, transform func(item T, in...
  function Shuffle (line 57) | func Shuffle[T any, Slice ~[]T](collection Slice) {
  function Reverse (line 65) | func Reverse[T any, Slice ~[]T](collection Slice) {

FILE: mutable/slice_example_test.go
  function ExampleFilter (line 5) | func ExampleFilter() {
  function ExampleFilterI (line 18) | func ExampleFilterI() {
  function ExampleMap (line 31) | func ExampleMap() {
  function ExampleMapI (line 42) | func ExampleMapI() {
  function ExampleShuffle (line 53) | func ExampleShuffle() {
  function ExampleReverse (line 61) | func ExampleReverse() {
  function Fill (line 72) | func Fill[T any, Slice ~[]T](collection Slice, initial T) {

FILE: mutable/slice_test.go
  function TestFilter (line 9) | func TestFilter(t *testing.T) {
  function TestFilterI (line 30) | func TestFilterI(t *testing.T) {
  function TestMap (line 42) | func TestMap(t *testing.T) {
  function TestMapI (line 59) | func TestMapI(t *testing.T) {
  function TestShuffle (line 78) | func TestShuffle(t *testing.T) {
  function TestReverse (line 91) | func TestReverse(t *testing.T) {
  function TestFill (line 113) | func TestFill(t *testing.T) {

FILE: parallel/slice.go
  function Map (line 8) | func Map[T, R any](collection []T, transform func(item T, index int) R) ...
  function ForEach (line 32) | func ForEach[T any](collection []T, callback func(item T, index int)) {
  function Times (line 50) | func Times[T any](count int, iteratee func(index int) T) []T {
  function GroupBy (line 75) | func GroupBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee...
  function PartitionBy (line 95) | func PartitionBy[T any, K comparable, Slice ~[]T](collection Slice, iter...

FILE: parallel/slice_test.go
  function TestMap (line 12) | func TestMap(t *testing.T) {
  function TestForEach (line 27) | func TestForEach(t *testing.T) {
  function TestTimes (line 40) | func TestTimes(t *testing.T) {
  function TestGroupBy (line 51) | func TestGroupBy(t *testing.T) {
  function TestPartitionBy (line 78) | func TestPartitionBy(t *testing.T) {

FILE: retry.go
  type debounce (line 10) | type debounce struct
    method reset (line 18) | func (d *debounce) reset() {
    method cancel (line 42) | func (d *debounce) cancel() {
  function NewDebounce (line 56) | func NewDebounce(duration time.Duration, f ...func()) (func(), func()) {
  type debounceByItem (line 70) | type debounceByItem struct
  type debounceBy (line 76) | type debounceBy struct
  method reset (line 83) | func (d *debounceBy[T]) reset(key T) {
  method cancel (line 119) | func (d *debounceBy[T]) cancel(key T) {
  function NewDebounceBy (line 139) | func NewDebounceBy[T comparable](duration time.Duration, f ...func(key T...
  function Attempt (line 155) | func Attempt(maxIteration int, f func(index int) error) (int, error) {
  function AttemptWithDelay (line 174) | func AttemptWithDelay(maxIteration int, delay time.Duration, f func(inde...
  function AttemptWhile (line 200) | func AttemptWhile(maxIteration int, f func(int) (error, bool)) (int, err...
  function AttemptWhileWithDelay (line 225) | func AttemptWhileWithDelay(maxIteration int, delay time.Duration, f func...
  type transactionStep (line 248) | type transactionStep struct
  function NewTransaction (line 255) | func NewTransaction[T any]() *Transaction[T] {
  type Transaction (line 262) | type Transaction struct
  method Then (line 268) | func (t *Transaction[T]) Then(exec func(T) (T, error), onRollback func(T...
  method Process (line 279) | func (t *Transaction[T]) Process(state T) (T, error) {
  type throttleBy (line 305) | type throttleBy struct
  method throttledFunc (line 314) | func (th *throttleBy[T]) throttledFunc(key T) {
  method reset (line 332) | func (th *throttleBy[T]) reset() {
  function NewThrottle (line 347) | func NewThrottle(interval time.Duration, f ...func()) (throttle, reset f...
  function NewThrottleWithCount (line 353) | func NewThrottleWithCount(interval time.Duration, count int, f ...func()...
  function NewThrottleBy (line 369) | func NewThrottleBy[T comparable](interval time.Duration, f ...func(key T...
  function NewThrottleByWithCount (line 375) | func NewThrottleByWithCount[T comparable](interval time.Duration, count ...

FILE: retry_example_test.go
  function ExampleNewDebounce (line 13) | func ExampleNewDebounce() {
  function ExampleNewDebounceBy (line 46) | func ExampleNewDebounceBy() {
  function ExampleAttempt (line 85) | func ExampleAttempt() {
  function ExampleAttemptWithDelay (line 109) | func ExampleAttemptWithDelay() {
  function ExampleTransaction (line 133) | func ExampleTransaction() {
  function ExampleTransaction_ok (line 181) | func ExampleTransaction_ok() {
  function ExampleTransaction_error (line 217) | func ExampleTransaction_error() {
  function ExampleNewThrottle (line 253) | func ExampleNewThrottle() {
  function ExampleNewThrottleWithCount (line 271) | func ExampleNewThrottleWithCount() {
  function ExampleNewThrottleBy (line 292) | func ExampleNewThrottleBy() {
  function ExampleNewThrottleByWithCount (line 314) | func ExampleNewThrottleByWithCount() {

FILE: retry_test.go
  function TestAttempt (line 12) | func TestAttempt(t *testing.T) {
  function TestAttemptWithDelay (line 53) | func TestAttemptWithDelay(t *testing.T) { //nolint:paralleltest
  function TestAttemptWhile (line 101) | func TestAttemptWhile(t *testing.T) {
  function TestAttemptWhileWithDelay (line 180) | func TestAttemptWhileWithDelay(t *testing.T) { //nolint:paralleltest
  function TestDebounce (line 266) | func TestDebounce(t *testing.T) { //nolint:paralleltest
  function TestDebounceBy (line 314) | func TestDebounceBy(t *testing.T) { //nolint:paralleltest
  function TestTransaction (line 409) | func TestTransaction(t *testing.T) {
  function TestNewThrottle (line 505) | func TestNewThrottle(t *testing.T) { //nolint:paralleltest
  function TestNewThrottleWithCount (line 534) | func TestNewThrottleWithCount(t *testing.T) { //nolint:paralleltest
  function TestNewThrottleBy (line 565) | func TestNewThrottleBy(t *testing.T) { //nolint:paralleltest
  function TestNewThrottleByWithCount (line 605) | func TestNewThrottleByWithCount(t *testing.T) { //nolint:paralleltest

FILE: slice.go
  function Filter (line 12) | func Filter[T any, Slice ~[]T](collection Slice, predicate func(item T, ...
  function FilterErr (line 27) | func FilterErr[T any, Slice ~[]T](collection Slice, predicate func(item ...
  function Map (line 45) | func Map[T, R any](collection []T, transform func(item T, index int) R) ...
  function MapErr (line 57) | func MapErr[T, R any](collection []T, transform func(item T, index int) ...
  function UniqMap (line 73) | func UniqMap[T any, R comparable](collection []T, transform func(item T,...
  function FilterMap (line 94) | func FilterMap[T, R any](collection []T, callback func(item T, index int...
  function FlatMap (line 110) | func FlatMap[T, R any](collection []T, transform func(item T, index int)...
  function FlatMapErr (line 124) | func FlatMapErr[T, R any](collection []T, transform func(item T, index i...
  function Reduce (line 141) | func Reduce[T, R any](collection []T, accumulator func(agg R, item T, in...
  function ReduceErr (line 152) | func ReduceErr[T, R any](collection []T, accumulator func(agg R, item T,...
  function ReduceRight (line 167) | func ReduceRight[T, R any](collection []T, accumulator func(agg R, item ...
  function ReduceRightErr (line 177) | func ReduceRightErr[T, R any](collection []T, accumulator func(agg R, it...
  function ForEach (line 192) | func ForEach[T any](collection []T, callback func(item T, index int)) {
  function ForEachWhile (line 201) | func ForEachWhile[T any](collection []T, predicate func(item T, index in...
  function Times (line 212) | func Times[T any](count int, iteratee func(index int) T) []T {
  function Uniq (line 225) | func Uniq[T comparable, Slice ~[]T](collection Slice) Slice {
  function UniqBy (line 245) | func UniqBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee ...
  function UniqByErr (line 267) | func UniqByErr[T any, U comparable, Slice ~[]T](collection Slice, iterat...
  function GroupBy (line 290) | func GroupBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee...
  function GroupByErr (line 305) | func GroupByErr[T any, U comparable, Slice ~[]T](collection Slice, itera...
  function GroupByMap (line 322) | func GroupByMap[T any, K comparable, V any](collection []T, transform fu...
  function GroupByMapErr (line 336) | func GroupByMapErr[T any, K comparable, V any](collection []T, transform...
  function Chunk (line 354) | func Chunk[T any, Slice ~[]T](collection Slice, size int) []Slice {
  function PartitionBy (line 385) | func PartitionBy[T any, K comparable, Slice ~[]T](collection Slice, iter...
  function PartitionByErr (line 412) | func PartitionByErr[T any, K comparable, Slice ~[]T](collection Slice, i...
  function Flatten (line 437) | func Flatten[T any, Slice ~[]T](collection []Slice) Slice {
  function Concat (line 454) | func Concat[T any, Slice ~[]T](collections ...Slice) Slice {
  function Window (line 461) | func Window[T any, Slice ~[]T](collection Slice, size int) []Slice {
  function Sliding (line 472) | func Sliding[T any, Slice ~[]T](collection Slice, size, step int) []Slice {
  function Interleave (line 499) | func Interleave[T any, Slice ~[]T](collections ...Slice) Slice {
  function Shuffle (line 539) | func Shuffle[T any, Slice ~[]T](collection Slice) Slice {
  function Reverse (line 548) | func Reverse[T any, Slice ~[]T](collection Slice) Slice {
  function Fill (line 555) | func Fill[T Clonable[T], Slice ~[]T](collection Slice, initial T) Slice {
  function Repeat (line 567) | func Repeat[T Clonable[T]](count int, initial T) []T {
  function RepeatBy (line 579) | func RepeatBy[T any](count int, callback func(index int) T) []T {
  function RepeatByErr (line 591) | func RepeatByErr[T any](count int, callback func(index int) (T, error)) ...
  function KeyBy (line 607) | func KeyBy[K comparable, V any](collection []V, iteratee func(item V) K)...
  function KeyByErr (line 621) | func KeyByErr[K comparable, V any](collection []V, iteratee func(item V)...
  function Associate (line 639) | func Associate[T any, K comparable, V any](collection []T, transform fun...
  function AssociateI (line 649) | func AssociateI[T any, K comparable, V any](collection []T, transform fu...
  function SliceTo
Condensed preview — 650 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,501K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 17,
    "preview": "github: [samber]\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE/config.yml",
    "chars": 171,
    "preview": "template_chooser:\n  enabled: true\n  default: \"other.md\"\n  choices:\n    - name: \"New Helper\"\n      file: \"new_helper.md\"\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE/new_helper.md",
    "chars": 1051,
    "preview": "\n## Describe your changes\n\n...\n\n## Checklist before requesting a review\n\n- [ ] 👓 I have performed a self-review of my co"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE/other.md",
    "chars": 0,
    "preview": ""
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 529,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: github-actions\n    directory: /\n    schedule:\n      interval: monthly\n\n  - pa"
  },
  {
    "path": ".github/workflows/doc.yml",
    "chars": 1618,
    "preview": "name: Documentation\n\non:\n  pull_request:\n    paths:\n      - 'docs/**'\n  push:\n    paths:\n      - 'docs/**'\n\njobs:\n  buil"
  },
  {
    "path": ".github/workflows/lint.yml",
    "chars": 1066,
    "preview": "name: Lint\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n  schedule:\n    - cron: '0 3 * * 1'\n\njobs:\n  analyz"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 1390,
    "preview": "name: Release\n\non:\n  workflow_dispatch:\n    inputs:\n      semver:\n        type: string\n        description: 'Semver (eg:"
  },
  {
    "path": ".github/workflows/test.simd.yml",
    "chars": 751,
    "preview": "name: Tests (SIMD)\n\non:\n  push:\n    branches:\n      - master\n    paths:\n      - 'exp/simd/**'\n  pull_request:\n    paths:"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 911,
    "preview": "name: Tests\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    stra"
  },
  {
    "path": ".gitignore",
    "chars": 757,
    "preview": "\n# Created by https://www.toptal.com/developers/gitignore/api/go\n# Edit at https://www.toptal.com/developers/gitignore?t"
  },
  {
    "path": ".golangci.yml",
    "chars": 1981,
    "preview": "version: \"2\"\nrun:\n  concurrency: 4\n  # also lint _test.go files\n  tests: true\n  timeout: 5m\nlinters:\n  enable:\n    - gov"
  },
  {
    "path": "Dockerfile",
    "chars": 97,
    "preview": "\nFROM golang:1.23.1\n\nWORKDIR /go/src/github.com/samber/lo\n\nCOPY Makefile go.* ./\n\nRUN make tools\n"
  },
  {
    "path": "LICENSE",
    "chars": 1075,
    "preview": "MIT License\n\nCopyright (c) 2022-2025 Samuel Berthe\n\nPermission is hereby granted, free of charge, to any person obtainin"
  },
  {
    "path": "Makefile",
    "chars": 2092,
    "preview": "# Only build/test/lint exp/simd when Go version is >= 1.26 (requires goexperiment.simd)\nGO_VERSION := $(shell go version"
  },
  {
    "path": "README.md",
    "chars": 116095,
    "preview": "\n# lo - Iterate over slices, maps, channels...\n\n[![tag](https://img.shields.io/github/tag/samber/lo.svg)](https://github"
  },
  {
    "path": "benchmark/CLAUDE.md",
    "chars": 2333,
    "preview": "# Benchmark Guidelines\n\n## File Organization\n\nBenchmark files follow the naming convention:\n\n```\nbenchmark/{package}_{ca"
  },
  {
    "path": "benchmark/core_condition_bench_test.go",
    "chars": 896,
    "preview": "package benchmark\n\nimport (\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkIf(b *testing.B) {\n\tfor i := 0; i < b.N"
  },
  {
    "path": "benchmark/core_find_bench_test.go",
    "chars": 6386,
    "preview": "package benchmark\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkIndexOf(b *testing.B) {\n\tfor"
  },
  {
    "path": "benchmark/core_intersect_bench_test.go",
    "chars": 4051,
    "preview": "package benchmark\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkContains(b *testing.B) {\n\tfo"
  },
  {
    "path": "benchmark/core_map_bench_test.go",
    "chars": 7086,
    "preview": "package benchmark\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n\tlop \"github.com/samber/lo/parallel\"\n\t\"github"
  },
  {
    "path": "benchmark/core_math_bench_test.go",
    "chars": 2351,
    "preview": "package benchmark\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkRange(b *testing.B) {\n\tfor _"
  },
  {
    "path": "benchmark/core_slice_bench_test.go",
    "chars": 22767,
    "preview": "package benchmark\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkChunk(b *test"
  },
  {
    "path": "benchmark/core_string_bench_test.go",
    "chars": 1481,
    "preview": "package benchmark\n\nimport (\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkRandomString(b *testing.B) {\n\tfor i := "
  },
  {
    "path": "benchmark/core_tuples_bench_test.go",
    "chars": 862,
    "preview": "package benchmark\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkZip2_Equal(b *testing.B) {\n\tfor "
  },
  {
    "path": "benchmark/core_type_manipulation_bench_test.go",
    "chars": 1363,
    "preview": "package benchmark\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n)\n\nfunc BenchmarkToPtr(b *testing.B) {\n\tfor i"
  },
  {
    "path": "benchmark/helpers_test.go",
    "chars": 1441,
    "preview": "package benchmark\n\nimport (\n\t\"math/rand\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar lengths = []int{10, 100, 1000}\n\nfunc genSliceString(n"
  },
  {
    "path": "benchmark/it_find_bench_test.go",
    "chars": 7152,
    "preview": "//go:build go1.23\n\npackage benchmark\n\nimport (\n\t\"fmt\"\n\t\"math/rand/v2\"\n\t\"testing\"\n\n\t\"github.com/samber/lo/it\"\n)\n\nfunc Ben"
  },
  {
    "path": "benchmark/it_helpers_test.go",
    "chars": 996,
    "preview": "//go:build go1.23\n\npackage benchmark\n\nimport (\n\t\"iter\"\n\t\"math/rand/v2\"\n\t\"strconv\"\n)\n\nvar itLengths = []int{10, 100, 1000"
  },
  {
    "path": "benchmark/it_map_bench_test.go",
    "chars": 2928,
    "preview": "//go:build go1.23\n\npackage benchmark\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/samber/lo/it\"\n)\n\nfunc Benchmar"
  },
  {
    "path": "benchmark/it_math_bench_test.go",
    "chars": 1557,
    "preview": "//go:build go1.23\n\npackage benchmark\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/samber/lo/it\"\n)\n\nfunc BenchmarkItSum(b *t"
  },
  {
    "path": "benchmark/it_slice_bench_test.go",
    "chars": 13941,
    "preview": "//go:build go1.23\n\npackage benchmark\n\nimport (\n\t\"fmt\"\n\t\"iter\"\n\t\"testing\"\n\n\t\"github.com/samber/lo/it\"\n)\n\nfunc BenchmarkIt"
  },
  {
    "path": "benchmark/it_type_manipulation_bench_test.go",
    "chars": 824,
    "preview": "//go:build go1.23\n\npackage benchmark\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/samber/lo/it\"\n)\n\nfunc BenchmarkItToSeqPtr"
  },
  {
    "path": "benchmark/mutable_slice_bench_test.go",
    "chars": 1873,
    "preview": "package benchmark\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/samber/lo/mutable\"\n)\n\nfunc BenchmarkMutableFilter(b *testing"
  },
  {
    "path": "benchmark/parallel_slice_bench_test.go",
    "chars": 1346,
    "preview": "package benchmark\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tlop \"github.com/samber/lo/parallel\"\n)\n\nfunc BenchmarkParallelMap(b *test"
  },
  {
    "path": "channel.go",
    "chars": 8541,
    "preview": "package lo\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/samber/lo/internal/xrand\"\n)\n\n// DispatchingStrategy is a f"
  },
  {
    "path": "channel_test.go",
    "chars": 9946,
    "preview": "package lo\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestChannelDispatcher("
  },
  {
    "path": "concurrency.go",
    "chars": 4068,
    "preview": "package lo\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n)\n\ntype synchronize struct {\n\tlocker sync.Locker\n}\n\nfunc (s *synchronize"
  },
  {
    "path": "concurrency_test.go",
    "chars": 8824,
    "preview": "package lo\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestSynchroniz"
  },
  {
    "path": "condition.go",
    "chars": 3365,
    "preview": "package lo\n\n// Ternary is a single line if/else statement.\n// Take care to avoid dereferencing potentially nil pointers "
  },
  {
    "path": "condition_test.go",
    "chars": 2695,
    "preview": "package lo\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestTernary(t *testing.T) {\n\tt.Parallel()"
  },
  {
    "path": "constraints.go",
    "chars": 125,
    "preview": "package lo\n\n// Clonable defines a constraint of types having Clone() T method.\ntype Clonable[T any] interface {\n\tClone()"
  },
  {
    "path": "docs/.gitignore",
    "chars": 233,
    "preview": "# Dependencies\n/node_modules\n\n# Production\n/build\n\n# Generated files\n.docusaurus\n.cache-loader\n\n# Misc\n.DS_Store\n.env.lo"
  },
  {
    "path": "docs/CLAUDE.md",
    "chars": 12409,
    "preview": "# Adding New Helper Documentation\n\nWhen adding a new helper to the `lo` library, follow these guidelines to create or up"
  },
  {
    "path": "docs/README.md",
    "chars": 774,
    "preview": "# Website\n\nThis website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.\n\n## Inst"
  },
  {
    "path": "docs/data/core-assert.md",
    "chars": 1467,
    "preview": "---\nname: Assert\nslug: assert\nsourceRef: errors.go#L359\ncategory: core\nsubCategory: error-handling\nplayUrl: https://go.d"
  },
  {
    "path": "docs/data/core-assign.md",
    "chars": 566,
    "preview": "---\nname: Assign\nslug: assign\nsourceRef: map.go#L234\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/p/Vhwf"
  },
  {
    "path": "docs/data/core-associate.md",
    "chars": 2023,
    "preview": "---\nname: Associate\nslug: associate\nsourceRef: slice.go#L389\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-asyncx.md",
    "chars": 1295,
    "preview": "---\nname: AsyncX\nslug: asyncx\nsourceRef: concurrency.go#L35\ncategory: core\nsubCategory: concurrency\nsignatures:\n  - \"fun"
  },
  {
    "path": "docs/data/core-attempt.md",
    "chars": 1387,
    "preview": "---\nname: Attempt\nslug: attempt\nsourceRef: retry.go#L153\ncategory: core\nsubCategory: retry\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-attemptwhile.md",
    "chars": 715,
    "preview": "---\nname: AttemptWhile\nslug: attemptwhile\nsourceRef: retry.go#L198\ncategory: core\nsubCategory: retry\nplayUrl: https://go"
  },
  {
    "path": "docs/data/core-attemptwhilewithdelay.md",
    "chars": 742,
    "preview": "---\nname: AttemptWhileWithDelay\nslug: attemptwhilewithdelay\nsourceRef: retry.go#L223\ncategory: core\nsubCategory: retry\np"
  },
  {
    "path": "docs/data/core-attemptwithdelay.md",
    "chars": 819,
    "preview": "---\nname: AttemptWithDelay\nslug: attemptwithdelay\nsourceRef: retry.go#L172\ncategory: core\nsubCategory: retry\nplayUrl: ht"
  },
  {
    "path": "docs/data/core-buffer.md",
    "chars": 1427,
    "preview": "---\nname: Buffer\nslug: buffer\nsourceRef: channel.go#L214\ncategory: core\nsubCategory: channel\nsignatures:\n  - \"func Buffe"
  },
  {
    "path": "docs/data/core-bufferwithtimeout.md",
    "chars": 769,
    "preview": "---\nname: BufferWithTimeout\nslug: bufferwithtimeout\nsourceRef: channel.go#L214\ncategory: core\nsubCategory: channel\nsigna"
  },
  {
    "path": "docs/data/core-camelcase.md",
    "chars": 485,
    "preview": "---\nname: CamelCase\nslug: camelcase\nsourceRef: string.go#L176\ncategory: core\nsubCategory: string\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-capitalize.md",
    "chars": 547,
    "preview": "---\nname: Capitalize\nslug: capitalize\nsourceRef: string.go#L227\ncategory: core\nsubCategory: string\nplayUrl: https://go.d"
  },
  {
    "path": "docs/data/core-channeldispatcher.md",
    "chars": 724,
    "preview": "---\nname: ChannelDispatcher\nslug: channeldispatcher\nsourceRef: channel.go#L18\ncategory: core\nsubCategory: channel\nsignat"
  },
  {
    "path": "docs/data/core-channeltoslice.md",
    "chars": 491,
    "preview": "---\nname: ChannelToSlice\nslug: channeltoslice\nsourceRef: channel.go#L18\ncategory: core\nsubCategory: channel\nsignatures:\n"
  },
  {
    "path": "docs/data/core-chunk.md",
    "chars": 882,
    "preview": "---\nname: Chunk\nslug: chunk\nsourceRef: slice.go#L209\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/kE"
  },
  {
    "path": "docs/data/core-chunkentries.md",
    "chars": 645,
    "preview": "---\nname: ChunkEntries\nslug: chunkentries\nsourceRef: map.go#L253\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-chunkstring.md",
    "chars": 592,
    "preview": "---\nname: ChunkString\nslug: chunkstring\nsourceRef: string.go#L130\ncategory: core\nsubCategory: string\nplayUrl: https://go"
  },
  {
    "path": "docs/data/core-clamp.md",
    "chars": 507,
    "preview": "---\nname: Clamp\nslug: clamp\nsourceRef: math.go#L59\ncategory: core\nsubCategory: math\nplayUrl: https://go.dev/play/p/RU4lJ"
  },
  {
    "path": "docs/data/core-clone.md",
    "chars": 553,
    "preview": "---\nname: Clone\nslug: clone\nsourceRef: slice.go#L741\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/66"
  },
  {
    "path": "docs/data/core-coalesce.md",
    "chars": 1348,
    "preview": "---\nname: Coalesce\nslug: coalesce\nsourceRef: type_manipulation.go#L153\ncategory: core\nsubCategory: type\nsignatures:\n  - "
  },
  {
    "path": "docs/data/core-coalescemap.md",
    "chars": 964,
    "preview": "---\nname: CoalesceMap\nslug: coalescemap\nsourceRef: type_manipulation.go#L196\ncategory: core\nsubCategory: type\nsignatures"
  },
  {
    "path": "docs/data/core-coalescemaporempty.md",
    "chars": 955,
    "preview": "---\nname: CoalesceMapOrEmpty\nslug: coalescemaporempty\nsourceRef: type_manipulation.go#L207\ncategory: core\nsubCategory: t"
  },
  {
    "path": "docs/data/core-coalesceorempty.md",
    "chars": 817,
    "preview": "---\nname: CoalesceOrEmpty\nslug: coalesceorempty\nsourceRef: type_manipulation.go#L167\ncategory: core\nsubCategory: type\nsi"
  },
  {
    "path": "docs/data/core-coalesceslice.md",
    "chars": 866,
    "preview": "---\nname: CoalesceSlice\nslug: coalesceslice\nsourceRef: type_manipulation.go#L174\ncategory: core\nsubCategory: type\nsignat"
  },
  {
    "path": "docs/data/core-coalescesliceorempty.md",
    "chars": 857,
    "preview": "---\nname: CoalesceSliceOrEmpty\nslug: coalescesliceorempty\nsourceRef: type_manipulation.go#L185\ncategory: core\nsubCategor"
  },
  {
    "path": "docs/data/core-compact.md",
    "chars": 512,
    "preview": "---\nname: Compact\nslug: compact\nsourceRef: slice.go#L706\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-concat.md",
    "chars": 583,
    "preview": "---\nname: Concat\nslug: concat\nsourceRef: slice.go#L282\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/"
  },
  {
    "path": "docs/data/core-contains.md",
    "chars": 547,
    "preview": "---\nname: Contains\nslug: contains\nsourceRef: intersect.go#L5\ncategory: core\nsubCategory: intersect\nplayUrl: https://go.d"
  },
  {
    "path": "docs/data/core-containsby.md",
    "chars": 705,
    "preview": "---\nname: ContainsBy\nslug: containsby\nsourceRef: intersect.go#L17\ncategory: core\nsubCategory: intersect\nplayUrl: https:/"
  },
  {
    "path": "docs/data/core-count.md",
    "chars": 483,
    "preview": "---\nname: Count\nslug: count\nsourceRef: slice.go#L582\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/Y3"
  },
  {
    "path": "docs/data/core-countby.md",
    "chars": 570,
    "preview": "---\nname: CountBy\nslug: countby\nsourceRef: slice.go#L849\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-countbyerr.md",
    "chars": 890,
    "preview": "---\nname: CountByErr\nslug: countbyerr\nsourceRef: slice.go#L863\ncategory: core\nsubCategory: slice\nsignatures:\n  - \"func C"
  },
  {
    "path": "docs/data/core-countvalues.md",
    "chars": 548,
    "preview": "---\nname: CountValues\nslug: countvalues\nsourceRef: slice.go#L610\ncategory: core\nsubCategory: slice\nplayUrl: https://go.d"
  },
  {
    "path": "docs/data/core-countvaluesby.md",
    "chars": 657,
    "preview": "---\nname: CountValuesBy\nslug: countvaluesby\nsourceRef: slice.go#L623\ncategory: core\nsubCategory: slice\nplayUrl: https://"
  },
  {
    "path": "docs/data/core-crossjoinbyerrx.md",
    "chars": 2670,
    "preview": "---\nname: CrossJoinByErrX\nslug: crossjoinbyerrx\nsourceRef: tuples.go#L1320\ncategory: core\nsubCategory: tuple\nsignatures:"
  },
  {
    "path": "docs/data/core-crossjoinbyx.md",
    "chars": 2023,
    "preview": "---\nname: CrossJoinByX\nslug: crossjoinbyx\nsourceRef: tuples.go#L956\ncategory: core\nsubCategory: tuple\nsignatures:\n  - \"f"
  },
  {
    "path": "docs/data/core-crossjoinx.md",
    "chars": 1600,
    "preview": "---\nname: CrossJoinX\nslug: crossjoinx\nsourceRef: tuples.go#L891\ncategory: core\nsubCategory: tuple\nsignatures:\n  - \"func "
  },
  {
    "path": "docs/data/core-cut.md",
    "chars": 932,
    "preview": "---\nname: Cut\nslug: cut\nsourceRef: slice.go#L774\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/GiL3qh"
  },
  {
    "path": "docs/data/core-cutprefix.md",
    "chars": 855,
    "preview": "---\nname: CutPrefix\nslug: cutprefix\nsourceRef: slice.go#L800\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-cutsuffix.md",
    "chars": 889,
    "preview": "---\nname: CutSuffix\nslug: cutsuffix\nsourceRef: slice.go#L821\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-difference.md",
    "chars": 744,
    "preview": "---\nname: Difference\nslug: difference\nsourceRef: intersect.go#L124\ncategory: core\nsubCategory: intersect\nplayUrl: https:"
  },
  {
    "path": "docs/data/core-dispatchingstrategy.md",
    "chars": 2578,
    "preview": "---\nname: DispatchingStrategy\nslug: dispatchingstrategy\nsourceRef: channel.go#L78\ncategory: core\nsubCategory: channel\nsi"
  },
  {
    "path": "docs/data/core-drop.md",
    "chars": 593,
    "preview": "---\nname: Drop\nslug: drop\nsourceRef: slice.go#L441\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/JswS"
  },
  {
    "path": "docs/data/core-dropbyindex.md",
    "chars": 639,
    "preview": "---\nname: DropByIndex\nslug: dropbyindex\nsourceRef: slice.go#L501\ncategory: core\nsubCategory: slice\nplayUrl: https://go.d"
  },
  {
    "path": "docs/data/core-dropright.md",
    "chars": 587,
    "preview": "---\nname: DropRight\nslug: dropright\nsourceRef: slice.go#L457\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-droprightwhile.md",
    "chars": 706,
    "preview": "---\nname: DropRightWhile\nslug: droprightwhile\nsourceRef: slice.go#L486\ncategory: core\nsubCategory: slice\nplayUrl: https:"
  },
  {
    "path": "docs/data/core-dropwhile.md",
    "chars": 718,
    "preview": "---\nname: DropWhile\nslug: dropwhile\nsourceRef: slice.go#L472\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-durationx.md",
    "chars": 2387,
    "preview": "---\nname: DurationX\nslug: durationx\nsourceRef: time.go#L7\ncategory: core\nsubCategory: time\nsignatures:\n  - \"func Duratio"
  },
  {
    "path": "docs/data/core-earliest.md",
    "chars": 786,
    "preview": "---\nname: Earliest\nslug: earliest\nsourceRef: find.go#L363\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-earliestby.md",
    "chars": 928,
    "preview": "---\nname: EarliestBy\nslug: earliestby\nsourceRef: find.go#L462\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-earliestbyerr.md",
    "chars": 1339,
    "preview": "---\nname: EarliestByErr\nslug: earliestbyerr\nsourceRef: find.go#L484\ncategory: core\nsubCategory: find\nplayUrl: https://go"
  },
  {
    "path": "docs/data/core-elementsmatch.md",
    "chars": 888,
    "preview": "---\nname: ElementsMatch\nslug: elementsmatch\nsourceRef: intersect.go#L247\ncategory: core\nsubCategory: intersect\nplayUrl: "
  },
  {
    "path": "docs/data/core-elementsmatchby.md",
    "chars": 996,
    "preview": "---\nname: ElementsMatchBy\nslug: elementsmatchby\nsourceRef: intersect.go#L255\ncategory: core\nsubCategory: intersect\nplayU"
  },
  {
    "path": "docs/data/core-ellipsis.md",
    "chars": 837,
    "preview": "---\nname: Ellipsis\nslug: ellipsis\nsourceRef: string.go#L235\ncategory: core\nsubCategory: string\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-empty.md",
    "chars": 785,
    "preview": "---\nname: Empty\nslug: empty\nsourceRef: type_manipulation.go#L132\ncategory: core\nsubCategory: type\nsignatures:\n  - \"func "
  },
  {
    "path": "docs/data/core-emptyabletoptr.md",
    "chars": 773,
    "preview": "---\nname: EmptyableToPtr\nslug: emptyabletoptr\nsourceRef: type_manipulation.go#L41\ncategory: core\nsubCategory: type\nsigna"
  },
  {
    "path": "docs/data/core-entries.md",
    "chars": 564,
    "preview": "---\nname: Entries\nslug: entries\nsourceRef: map.go#L179\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/p/_t"
  },
  {
    "path": "docs/data/core-errorsas.md",
    "chars": 758,
    "preview": "---\nname: ErrorsAs\nslug: errorsas\nsourceRef: errors.go#L351\ncategory: core\nsubCategory: error-handling\nplayUrl: https://"
  },
  {
    "path": "docs/data/core-every.md",
    "chars": 714,
    "preview": "---\nname: Every\nslug: every\nsourceRef: intersect.go#L29\ncategory: core\nsubCategory: intersect\nplayUrl: https://go.dev/pl"
  },
  {
    "path": "docs/data/core-everyby.md",
    "chars": 782,
    "preview": "---\nname: EveryBy\nslug: everyby\nsourceRef: intersect.go#L41\ncategory: core\nsubCategory: intersect\nplayUrl: https://go.de"
  },
  {
    "path": "docs/data/core-fanin.md",
    "chars": 816,
    "preview": "---\nname: FanIn\nslug: fanin\nsourceRef: channel.go#L18\ncategory: core\nsubCategory: channel\nsignatures:\n  - \"func FanIn[T "
  },
  {
    "path": "docs/data/core-fanout.md",
    "chars": 553,
    "preview": "---\nname: FanOut\nslug: fanout\nsourceRef: channel.go#L18\ncategory: core\nsubCategory: channel\nsignatures:\n  - \"func FanOut"
  },
  {
    "path": "docs/data/core-fill.md",
    "chars": 812,
    "preview": "---\nname: Fill\nslug: fill\nsourceRef: slice.go#L338\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/VwR3"
  },
  {
    "path": "docs/data/core-filter.md",
    "chars": 743,
    "preview": "---\nname: Filter\nslug: filter\nsourceRef: slice.go#L12\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/A"
  },
  {
    "path": "docs/data/core-filtererr.md",
    "chars": 1034,
    "preview": "---\nname: FilterErr\nslug: filtererr\nsourceRef: slice.go#L27\ncategory: core\nsubCategory: slice\nsignatures:\n  - \"func Filt"
  },
  {
    "path": "docs/data/core-filterkeys.md",
    "chars": 684,
    "preview": "---\nname: FilterKeys\nslug: filterkeys\nsourceRef: map.go#L350\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/pla"
  },
  {
    "path": "docs/data/core-filterkeyserr.md",
    "chars": 1164,
    "preview": "---\nname: FilterKeysErr\nslug: filterkeyserr\nsourceRef: map.go#L498\ncategory: core\nsubCategory: map\nsignatures:\n  - \"func"
  },
  {
    "path": "docs/data/core-filtermap.md",
    "chars": 974,
    "preview": "---\nname: FilterMap\nslug: filtermap\nsourceRef: slice.go#L58\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/pl"
  },
  {
    "path": "docs/data/core-filtermaptoslice.md",
    "chars": 815,
    "preview": "---\nname: FilterMapToSlice\nslug: filtermaptoslice\nsourceRef: map.go#L430\ncategory: core\nsubCategory: map\nplayUrl: https:"
  },
  {
    "path": "docs/data/core-filtermaptosliceerr.md",
    "chars": 1183,
    "preview": "---\nname: FilterMapToSliceErr\nslug: filtermaptosliceerr\nsourceRef: map.go#L443\ncategory: core\nsubCategory: map\nsignature"
  },
  {
    "path": "docs/data/core-filterreject.md",
    "chars": 728,
    "preview": "---\nname: FilterReject\nslug: filterreject\nsourceRef: slice.go#L565\ncategory: core\nsubCategory: slice\nplayUrl: https://go"
  },
  {
    "path": "docs/data/core-filterslicetomap.md",
    "chars": 761,
    "preview": "---\nname: FilterSliceToMap\nslug: filterslicetomap\nsourceRef: slice.go#L414\ncategory: core\nsubCategory: slice\nplayUrl: ht"
  },
  {
    "path": "docs/data/core-filtervalues.md",
    "chars": 703,
    "preview": "---\nname: FilterValues\nslug: filtervalues\nsourceRef: map.go#L365\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-filtervalueserr.md",
    "chars": 1192,
    "preview": "---\nname: FilterValuesErr\nslug: filtervalueserr\nsourceRef: map.go#L519\ncategory: core\nsubCategory: map\nsignatures:\n  - \""
  },
  {
    "path": "docs/data/core-find.md",
    "chars": 778,
    "preview": "---\nname: Find\nslug: find\nsourceRef: find.go#L72\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/Eo7W0lv"
  },
  {
    "path": "docs/data/core-findduplicates.md",
    "chars": 569,
    "preview": "---\nname: FindDuplicates\nslug: findduplicates\nsourceRef: find.go#L207\ncategory: core\nsubCategory: find\nplayUrl: https://"
  },
  {
    "path": "docs/data/core-findduplicatesby.md",
    "chars": 674,
    "preview": "---\nname: FindDuplicatesBy\nslug: findduplicatesby\nsourceRef: find.go#L234\ncategory: core\nsubCategory: find\nplayUrl: http"
  },
  {
    "path": "docs/data/core-findduplicatesbyerr.md",
    "chars": 1072,
    "preview": "---\nname: FindDuplicatesByErr\nslug: findduplicatesbyerr\nsourceRef: find.go#L296\ncategory: core\nsubCategory: find\nplayUrl"
  },
  {
    "path": "docs/data/core-finderr.md",
    "chars": 1149,
    "preview": "---\nname: FindErr\nslug: finderr\nsourceRef: find.go#L83\ncategory: core\nsubCategory: find\nsignatures:\n  - \"func FindErr[T "
  },
  {
    "path": "docs/data/core-findindexof.md",
    "chars": 639,
    "preview": "---\nname: FindIndexOf\nslug: findindexof\nsourceRef: find.go#L87\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/"
  },
  {
    "path": "docs/data/core-findkey.md",
    "chars": 517,
    "preview": "---\nname: FindKey\nslug: findkey\nsourceRef: find.go#L128\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/"
  },
  {
    "path": "docs/data/core-findkeyby.md",
    "chars": 613,
    "preview": "---\nname: FindKeyBy\nslug: findkeyby\nsourceRef: find.go#L140\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/pla"
  },
  {
    "path": "docs/data/core-findlastindexof.md",
    "chars": 688,
    "preview": "---\nname: FindLastIndexOf\nslug: findlastindexof\nsourceRef: find.go#L101\ncategory: core\nsubCategory: find\nplayUrl: https:"
  },
  {
    "path": "docs/data/core-findorelse.md",
    "chars": 723,
    "preview": "---\nname: FindOrElse\nslug: findorelse\nsourceRef: find.go#L116\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-finduniques.md",
    "chars": 553,
    "preview": "---\nname: FindUniques\nslug: finduniques\nsourceRef: find.go#L152\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-finduniquesby.md",
    "chars": 631,
    "preview": "---\nname: FindUniquesBy\nslug: finduniquesby\nsourceRef: find.go#L178\ncategory: core\nsubCategory: find\nplayUrl: https://go"
  },
  {
    "path": "docs/data/core-first.md",
    "chars": 573,
    "preview": "---\nname: First\nslug: first\nsourceRef: find.go#L554\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/94lu"
  },
  {
    "path": "docs/data/core-firstor.md",
    "chars": 488,
    "preview": "---\nname: FirstOr\nslug: firstor\nsourceRef: find.go#L574\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/"
  },
  {
    "path": "docs/data/core-firstorempty.md",
    "chars": 497,
    "preview": "---\nname: FirstOrEmpty\nslug: firstorempty\nsourceRef: find.go#L567\ncategory: core\nsubCategory: find\nplayUrl: https://go.d"
  },
  {
    "path": "docs/data/core-flatmap.md",
    "chars": 845,
    "preview": "---\nname: FlatMap\nslug: flatmap\nsourceRef: slice.go#L74\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p"
  },
  {
    "path": "docs/data/core-flatmaperr.md",
    "chars": 1157,
    "preview": "---\nname: FlatMapErr\nslug: flatmaperr\nsourceRef: slice.go#L99\ncategory: core\nsubCategory: slice\nsignatures:\n  - \"func Fl"
  },
  {
    "path": "docs/data/core-flatten.md",
    "chars": 481,
    "preview": "---\nname: Flatten\nslug: flatten\nsourceRef: slice.go#L266\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-foreach.md",
    "chars": 593,
    "preview": "---\nname: ForEach\nslug: foreach\nsourceRef: slice.go#L107\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-foreachwhile.md",
    "chars": 810,
    "preview": "---\nname: ForEachWhile\nslug: foreachwhile\nsourceRef: slice.go#L116\ncategory: core\nsubCategory: slice\nsignatures:\n  - \"fu"
  },
  {
    "path": "docs/data/core-fromanyslice.md",
    "chars": 962,
    "preview": "---\nname: FromAnySlice\nslug: fromanyslice\nsourceRef: type_manipulation.go#L118\ncategory: core\nsubCategory: type\nsignatur"
  },
  {
    "path": "docs/data/core-fromentries.md",
    "chars": 609,
    "preview": "---\nname: FromEntries\nslug: fromentries\nsourceRef: map.go#L201\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-frompairs.md",
    "chars": 580,
    "preview": "---\nname: FromPairs\nslug: frompairs\nsourceRef: map.go#L214\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-fromptr.md",
    "chars": 937,
    "preview": "---\nname: FromPtr\nslug: fromptr\nsourceRef: type_manipulation.go#L53\ncategory: core\nsubCategory: type\nsignatures:\n  - \"fu"
  },
  {
    "path": "docs/data/core-fromptror.md",
    "chars": 691,
    "preview": "---\nname: FromPtrOr\nslug: fromptror\nsourceRef: type_manipulation.go#L63\ncategory: core\nsubCategory: type\nsignatures:\n  -"
  },
  {
    "path": "docs/data/core-fromsliceptr.md",
    "chars": 782,
    "preview": "---\nname: FromSlicePtr\nslug: fromsliceptr\nsourceRef: type_manipulation.go#L85\ncategory: core\nsubCategory: type\nsignature"
  },
  {
    "path": "docs/data/core-generator.md",
    "chars": 591,
    "preview": "---\nname: Generator\nslug: generator\nsourceRef: channel.go#L18\ncategory: core\nsubCategory: channel\nsignatures:\n  - \"func "
  },
  {
    "path": "docs/data/core-groupby.md",
    "chars": 750,
    "preview": "---\nname: GroupBy\nslug: groupby\nsourceRef: slice.go#L180\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-groupbyerr.md",
    "chars": 1188,
    "preview": "---\nname: GroupByErr\nslug: groupbyerr\nsourceRef: slice.go#L279\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-groupbymap.md",
    "chars": 773,
    "preview": "---\nname: GroupByMap\nslug: groupbymap\nsourceRef: slice.go#L194\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-groupbymaperr.md",
    "chars": 1197,
    "preview": "---\nname: GroupByMapErr\nslug: groupbymaperr\nsourceRef: slice.go#L311\ncategory: core\nsubCategory: slice\nsignatures:\n  - \""
  },
  {
    "path": "docs/data/core-haskey.md",
    "chars": 536,
    "preview": "---\nname: HasKey\nslug: haskey\nsourceRef: map.go#L47\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/p/aVwub"
  },
  {
    "path": "docs/data/core-hasprefix.md",
    "chars": 517,
    "preview": "---\nname: HasPrefix\nslug: hasprefix\nsourceRef: find.go#L41\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play"
  },
  {
    "path": "docs/data/core-hassuffix.md",
    "chars": 516,
    "preview": "---\nname: HasSuffix\nslug: hassuffix\nsourceRef: find.go#L57\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play"
  },
  {
    "path": "docs/data/core-if.md",
    "chars": 1786,
    "preview": "---\nname: If/Else\nslug: if-else\nsourceRef: condition.go#L31\ncategory: core\nsubCategory: condition\nplayUrl: https://go.de"
  },
  {
    "path": "docs/data/core-indexof.md",
    "chars": 580,
    "preview": "---\nname: IndexOf\nslug: indexof\nsourceRef: find.go#L14\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/E"
  },
  {
    "path": "docs/data/core-interleave.md",
    "chars": 694,
    "preview": "---\nname: Interleave\nslug: interleave\nsourceRef: slice.go#L282\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-intersect.md",
    "chars": 634,
    "preview": "---\nname: Intersect\nslug: intersect\nsourceRef: intersect.go#L103\ncategory: core\nsubCategory: intersect\nplayUrl: https://"
  },
  {
    "path": "docs/data/core-intersectby.md",
    "chars": 784,
    "preview": "---\nname: IntersectBy\nslug: intersectby\nsourceRef: intersect.go#L174\ncategory: core\nsubCategory: intersect\nplayUrl: http"
  },
  {
    "path": "docs/data/core-invert.md",
    "chars": 536,
    "preview": "---\nname: Invert\nslug: invert\nsourceRef: map.go#L222\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/p/rFQ4"
  },
  {
    "path": "docs/data/core-isempty.md",
    "chars": 853,
    "preview": "---\nname: IsEmpty\nslug: isempty\nsourceRef: type_manipulation.go#L139\ncategory: core\nsubCategory: type\nsignatures:\n  - \"f"
  },
  {
    "path": "docs/data/core-isnil.md",
    "chars": 691,
    "preview": "---\nname: IsNil\nslug: isnil\nsourceRef: type_manipulation.go#L7\ncategory: core\nsubCategory: type\nsignatures:\n  - \"func Is"
  },
  {
    "path": "docs/data/core-isnotempty.md",
    "chars": 866,
    "preview": "---\nname: IsNotEmpty\nslug: isnotempty\nsourceRef: type_manipulation.go#L146\ncategory: core\nsubCategory: type\nsignatures:\n"
  },
  {
    "path": "docs/data/core-isnotnil.md",
    "chars": 729,
    "preview": "---\nname: IsNotNil\nslug: isnil\nsourceRef: type_manipulation.go#L22\ncategory: core\nsubCategory: type\nsignatures:\n  - \"fun"
  },
  {
    "path": "docs/data/core-issorted.md",
    "chars": 478,
    "preview": "---\nname: IsSorted\nslug: issorted\nsourceRef: slice.go#L722\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/pla"
  },
  {
    "path": "docs/data/core-issortedby.md",
    "chars": 593,
    "preview": "---\nname: IsSortedBy\nslug: issortedby\nsourceRef: slice.go#L733\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-kebabcase.md",
    "chars": 486,
    "preview": "---\nname: KebabCase\nslug: kebabcase\nsourceRef: string.go#L190\ncategory: core\nsubCategory: string\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-keyby.md",
    "chars": 679,
    "preview": "---\nname: KeyBy\nslug: keyby\nsourceRef: slice.go#L374\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/cc"
  },
  {
    "path": "docs/data/core-keybyerr.md",
    "chars": 1138,
    "preview": "---\nname: KeyByErr\nslug: keybyerr\nsourceRef: slice.go#L576\ncategory: core\nsubCategory: slice\nsignatures:\n  - \"func KeyBy"
  },
  {
    "path": "docs/data/core-keyify.md",
    "chars": 552,
    "preview": "---\nname: Keyify\nslug: keyify\nsourceRef: slice.go#L429\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/"
  },
  {
    "path": "docs/data/core-keys.md",
    "chars": 788,
    "preview": "---\nname: Keys\nslug: keys\nsourceRef: map.go#L5\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/p/Uu11fHASqr"
  },
  {
    "path": "docs/data/core-last.md",
    "chars": 474,
    "preview": "---\nname: Last\nslug: last\nsourceRef: find.go#L585\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/ul45Z0"
  },
  {
    "path": "docs/data/core-lastindexof.md",
    "chars": 577,
    "preview": "---\nname: LastIndexOf\nslug: lastindexof\nsourceRef: find.go#L27\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/"
  },
  {
    "path": "docs/data/core-lastor.md",
    "chars": 481,
    "preview": "---\nname: LastOr\nslug: lastor\nsourceRef: find.go#L605\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/ul"
  },
  {
    "path": "docs/data/core-lastorempty.md",
    "chars": 490,
    "preview": "---\nname: LastOrEmpty\nslug: lastorempty\nsourceRef: find.go#L598\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-latest.md",
    "chars": 778,
    "preview": "---\nname: Latest\nslug: latest\nsourceRef: find.go#L508\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/dB"
  },
  {
    "path": "docs/data/core-latestby.md",
    "chars": 945,
    "preview": "---\nname: LatestBy\nslug: latestby\nsourceRef: find.go#L530\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-latestbyerr.md",
    "chars": 1467,
    "preview": "---\nname: LatestByErr\nslug: latestbyerr\nsourceRef: find.go#L737\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev"
  },
  {
    "path": "docs/data/core-map.md",
    "chars": 1378,
    "preview": "---\nname: Map\nslug: map\nsourceRef: slice.go#L26\ncategory: core\nsubCategory: slice\nplayUrl: https://go.dev/play/p/OkPcYAh"
  },
  {
    "path": "docs/data/core-mapentries.md",
    "chars": 702,
    "preview": "---\nname: MapEntries\nslug: mapentries\nsourceRef: map.go#L336\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/pla"
  },
  {
    "path": "docs/data/core-mapentrieserr.md",
    "chars": 1044,
    "preview": "---\nname: MapEntriesErr\nslug: mapentrieserr\nsourceRef: map.go#L351\ncategory: core\nsubCategory: map\nsignatures:\n  - \"func"
  },
  {
    "path": "docs/data/core-maperr.md",
    "chars": 1018,
    "preview": "---\nname: MapErr\nslug: maperr\nsourceRef: slice.go#L36\ncategory: core\nsubCategory: slice\nsignatures:\n  - \"func MapErr[T a"
  },
  {
    "path": "docs/data/core-mapkeys.md",
    "chars": 643,
    "preview": "---\nname: MapKeys\nslug: mapkeys\nsourceRef: map.go#L283\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/p/9_"
  },
  {
    "path": "docs/data/core-mapkeyserr.md",
    "chars": 974,
    "preview": "---\nname: MapKeysErr\nslug: mapkeyserr\nsourceRef: map.go#L293\ncategory: core\nsubCategory: map\nsignatures:\n  - \"func MapKe"
  },
  {
    "path": "docs/data/core-maptoslice.md",
    "chars": 691,
    "preview": "---\nname: MapToSlice\nslug: maptoslice\nsourceRef: map.go#L367\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/pla"
  },
  {
    "path": "docs/data/core-maptosliceerr.md",
    "chars": 1021,
    "preview": "---\nname: MapToSliceErr\nslug: maptosliceerr\nsourceRef: map.go#L379\ncategory: core\nsubCategory: map\nsignatures:\n  - \"func"
  },
  {
    "path": "docs/data/core-mapvalues.md",
    "chars": 661,
    "preview": "---\nname: MapValues\nslug: mapvalues\nsourceRef: map.go#L310\ncategory: core\nsubCategory: map\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-mapvalueserr.md",
    "chars": 1032,
    "preview": "---\nname: MapValuesErr\nslug: mapvalueserr\nsourceRef: map.go#L322\ncategory: core\nsubCategory: map\nsignatures:\n  - \"func M"
  },
  {
    "path": "docs/data/core-max.md",
    "chars": 634,
    "preview": "---\nname: Max\nslug: max\nsourceRef: find.go#L410\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/wYvG8gRR"
  },
  {
    "path": "docs/data/core-maxby.md",
    "chars": 964,
    "preview": "---\nname: MaxBy\nslug: maxby\nsourceRef: find.go#L507\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/PJCc"
  },
  {
    "path": "docs/data/core-maxbyerr.md",
    "chars": 1317,
    "preview": "---\nname: MaxByErr\nslug: maxbyerr\nsourceRef: find.go#L528\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-maxindex.md",
    "chars": 690,
    "preview": "---\nname: MaxIndex\nslug: maxindex\nsourceRef: find.go#L432\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-maxindexby.md",
    "chars": 1048,
    "preview": "---\nname: MaxIndexBy\nslug: maxindexby\nsourceRef: find.go#L566\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/p"
  },
  {
    "path": "docs/data/core-maxindexbyerr.md",
    "chars": 1360,
    "preview": "---\nname: MaxIndexByErr\nslug: maxindexbyerr\nsourceRef: find.go#L591\ncategory: core\nsubCategory: find\nvariantHelpers:\n  -"
  },
  {
    "path": "docs/data/core-mean.md",
    "chars": 623,
    "preview": "---\nname: Mean\nslug: mean\nsourceRef: math.go#L126\ncategory: core\nsubCategory: math\nplayUrl: https://go.dev/play/p/tPURSu"
  },
  {
    "path": "docs/data/core-meanby.md",
    "chars": 780,
    "preview": "---\nname: MeanBy\nslug: meanby\nsourceRef: math.go#L161\ncategory: core\nsubCategory: math\nplayUrl: https://go.dev/play/p/j7"
  },
  {
    "path": "docs/data/core-meanbyerr.md",
    "chars": 1187,
    "preview": "---\nname: MeanByErr\nslug: meanbyerr\nsourceRef: math.go#L172\ncategory: core\nsubCategory: math\nvariantHelpers:\n  - core#ma"
  },
  {
    "path": "docs/data/core-min.md",
    "chars": 552,
    "preview": "---\nname: Min\nslug: min\nsourceRef: find.go#L265\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/fJFLwpY8"
  },
  {
    "path": "docs/data/core-minby.md",
    "chars": 809,
    "preview": "---\nname: MinBy\nslug: minby\nsourceRef: find.go#L329\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/p/-B1P"
  },
  {
    "path": "docs/data/core-minbyerr.md",
    "chars": 1178,
    "preview": "---\nname: MinByErr\nslug: minbyerr\nsourceRef: find.go#L349\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/"
  },
  {
    "path": "docs/data/core-minindex.md",
    "chars": 690,
    "preview": "---\nname: MinIndex\nslug: minindex\nsourceRef: find.go#L287\ncategory: core\nsubCategory: find\nplayUrl: https://go.dev/play/"
  }
]

// ... and 450 more files (download for full content)

About this extraction

This page contains the full source code of the samber/lo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 650 files (2.2 MB), approximately 596.9k tokens, and a symbol index with 2669 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!