# 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)

Este módulo possui as implementações para utilizar em conjunto com o tipo [`IEnumerable<T>`](https://msdn.microsoft.com/pt-br/library/system.collections.ienumerable\(v=vs.110\).aspx).

Quando possível, os exemplos utilizarão o método de extensão, mas em todos os casos ele pode ser substituído pelo método do módulo.

> &#x20;**Atenção**&#x20;
>
> 1. O tipo `IEnumerable<T>` funciona sob o conceito de *lazy load*, este módulo respeita este comportamento, mas em alguns métodos é necessário realizar a avaliação do `IEnumerable`. Os métodos que realizam esta operação são sinalizados.
> 2. Nos métodos que envolvem duas ou mais coleções a função será aplicada somente até a quantidade de elementos da **menor** coleção.
> 3. Em alguns casos a ordem dos parâmetros é alterada para o método de extensão. Isso ocorre porque os métodos presentes no módulo são pensados para aplicação parcial, enquanto os métodos de extensão são pensados para se parecerem mais com os métodos da `System.Linq`.

## Métodos

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