# Either

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

This module provides several methods to works with [`Either<TLeft, TRight>`](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Types/Either/Introduction.html) type.

Many methods has an `Left` and `Right` version, these versions are used to apply the function only to one of possible types. This variants will be mentioned in each method page.

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

> **WARNING**
>
> 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

* [Exists](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/exists.html)
* [Iterate](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/iterate.html)
* [Fold](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/fold.html)
* [FoldBack](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/foldback.html)
* [Map](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/map.html)
* [Swap](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/swap.html)
* [ToTuple](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/totuple.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/either.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.
