# Option values

The optional values are a way of representing uncertain data, it is not always possible to be sure of the result of some operation.

These type of value are a new proposal rather than the [nullable types](https://docs.microsoft.com/pt-br/dotnet/csharp/programming-guide/nullable-types/).

The nullable types are problematics because these types looks like a real value, ocasionally this nullable values can cause an error from a tentative to access a method or property from an object that contains a null value. These exception ara called [ArgumentNullException](https://msdn.microsoft.com/pt-br/library/system.argumentnullexception%28v=vs.110%29.aspx).

Option values are also a way to encapsulate data without allows access to this data when it contains none. In some programming languages like Haskell, for instance, the Option type is represented by the [Maybe](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Maybe.html) type. A different name to the same concept.

An Option value can be in one of these two states:

* Some
* None

In this library propose, it's only possible to access a value from an Option type when these type is in `Some` state.

As you already must have noticed, the idea behind nullable and Option types are very similar, but in general terms, the Option type is more powerful, you avoid exceptions and you can use it with reference types as well.

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