# Lesson 10: Using inference

In this lesson, we’ll learn how to write and use functions effectively. We’ll start by seeing functions can be used like views in order to **abstract complex query patterns** into more maintainable forms. Then we’ll explore how we can use functions to build networks of logic, covering **function chaining** and **recursion**, allowing us to create complex behaviour from simple functions.

## [](#_recommended_prerequisites)Recommended prerequisites

*   You should complete [Lesson 8](../8-composing-clauses/index.md) before starting this lesson.
    

## [](#_lesson_contents)Lesson contents

[Lesson 10.1: Functions as views](10.1-functions-as-views/index.md)

Learn how to create simple abstractions for complex patterns.

[Lesson 10.2: Function chaining](10.2-function-chaining/index.md)

Learn how to chain functions, into each other and recursively.

[Summary](../9-modeling-schemas/summary/index.md) [Functions as views](10.1-functions-as-views/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/academy/modules/ROOT/pages/10-using-functions/index.adoc) Edit this page on GitHub.