# Collection

> [`Tango.Modules.CollectionModule`](https://github.com/gabrielschade/Tango/blob/master/Tango/Tango/Modules/Collection/CollectionModule.cs)
>
> [`Tango.Modules.Collection.Linq`](https://github.com/gabrielschade/Tango/blob/master/Tango/Tango/Modules/Collection/Collection.Linq.cs)

This module provides several methods to works with [`IEnumerable<T>`](https://msdn.microsoft.com/pt-br/library/system.collections.ienumerable%28v=vs.110%29.aspx) type.

When possible, the examples will use the extension method format, all of them can be replaced by module method without change any behavior.

> **WARNING**
>
> 1. The `IEnumerable<T>` is a *lazy load* type, this module works with it, but in some cases is necessary an evaluation of the collection. The methods that performs an evaluation are sinalized.
> 2. Some methods appling a given function to more than one collection, in these cases the loop will runs only until reach the size of **smallest** collection.
> 3. Some methods has different parameter order in extension and module versions. It occurs because the *static* methods in modules are optimized to partial application rather than extension methods that wants to improve usability to make a similar `System.Linq` sintax.

## Methods

* [Append](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/append.html)
* [Choose](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/choose.html)
* [ChunkBySize](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/chunkbysize.html)
* [Collect](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/collect.html)
* [CompareWith](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/comparewith.html)
* [CountBy](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/countby.html)
* [Concat](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/concat.html)
* [Distinct](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/distinct.html)
* [Empty](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/empty.html)
* [Exists](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/exists.html)
* [Exists2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/exists2.html)
* [Filter](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/filter.html)
* [FindIndex](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/findindex.html)
* [Fold](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/fold.html)
* [Fold2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/fold2.html)
* [FoldBack](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/foldback.html)
* [FoldBack2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/foldback2.html)
* [ForAll](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/forall.html)
* [ForAll2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/forall2.html)
* [ForAll3](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/forall3.html)
* [Head](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/head.html)
* [HeadAndTailEnd](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/headandtailend.html)
* [Range](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/range.html)
* [Generate](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/generate.html)
* [Initialize](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/initialize.html)
* [Iterate](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/iterate.html)
* [Iterate2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/iterate2.html)
* [IterateIndexed](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/iterateindexed.html)
* [IterateIndexed2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/iterateindexed2.html)
* [Map](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/map.html)
* [Map2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/map2.html)
* [Map3](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/map3.html)
* [MapIndexed](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/mapindexed.html)
* [MapIndexed2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/mapindexed2.html)
* [MapIndexed3](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/mapindexed3.html)
* [Partition](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/partition.html)
* [Permute](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/permute.html)
* [Pick](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/pick.html)
* [Reduce](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/reduce.html)
* [ReduceBack](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/reduceback.html)
* [Replicate](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/replicate.html)
* [Scan](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/scan.html)
* [Scan2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/scan2.html)
* [ScanBack](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/scanback.html)
* [ScanBack2](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/scanback2.html)
* [Tail](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/tail.html)
* [TryFind](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/tryfind.html)
* [Unzip](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/unzip.html)
* [Unzip3](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/unzip3.html)
* [Zip](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/zip.html)
* [Zip3](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Collection/zip3.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gabriel-schade-cardoso.gitbook.io/tango/modules/collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
