# Either values

The Either values, like the [Optionals](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Concepts/Optional%20Values.html), are a way to represents uncertain data, but at this time, instead of `None` state, it has another state called `Left` that can store useful data.

The either values limits the access of data contained in it, allowing the developer to access just the correct data through pattern matching.

Is possible to create an Either value that can be store an `int` and a `boolean`, but only one at time. These values can be in one of the two possibles states:

* Left - When contains a value typed by Left;
* Right - When contains a value typed by Right.

By convention, the Right type is used to represents correct values, and the Left type is used to represents data of incorrect values, similar to `Optional` but in this case, both states has a valid value.

This implementation was strongly inspired by Haskell [Either](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Either.html) type.

The implementations behind this concepts were done in two steps: the Either [type](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Types/Either/Introduction.html) and the [module](https://github.com/gabrielschade/tango/tree/379cc4a38ae47796971eb875ec66e7dc053a9081/Modules/Either/Introduction.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/fundamentals/either-values.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.
