> For the complete documentation index, see [llms.txt](https://swlaschin.gitbook.io/fsharpforfunandprofit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swlaschin.gitbook.io/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds.md).

# The "Recursive types and folds" Series

In this series, we'll look at recursive types and how to use them, and on the way, we'll look at catamorphisms, tail recursion, the difference between left and right folds, and more.

* [Introduction to recursive types](/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds/recursive-types-and-folds.md). Don't fear the catamorphism....
* [Catamorphism examples](/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds/recursive-types-and-folds-1b.md). Applying the rules to other domains.
* [Introducing Folds](/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds/recursive-types-and-folds-2.md). Threading state through a recursive data structure.
* [Understanding Folds](/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds/recursive-types-and-folds-2b.md). Recursion vs. iteration.
* [Generic recursive types](/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds/recursive-types-and-folds-3.md). Implementing a domain in three ways.
* [Trees in the real world](/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds/recursive-types-and-folds-3b.md). Examples using databases, JSON and error handling.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://swlaschin.gitbook.io/fsharpforfunandprofit/functional-patterns/recursive-types-and-folds.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.
