# Saindo do void para o Unit

Em algumas linguagens funcionais, **toda** função precisa retornar um tipo de valor. Para os casos onde não há um resultado real utilizamos o tipo `Unit`.

O tipo `Unit` é bastante similar ao tipo `void` em praticamente todos os aspectos. No entanto é possível construir um valor do tipo `Unit`, algo que não temos com o `void`.

Ou seja, é possível criar uma variável do tipo `Unit`, ela não conterá nenhuma informação e nenhum tipo de comportamento, no entanto é algo concreto.

Este valor é útil para permitir a conversão entre uma `Action` e uma `Func`, além disso, permite que operações que não geram retorno sejam colocadas em uma cadeia de execuções.


---

# 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/conceitos/from-void-to-unit.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.
