liveBook · Manning

Recursive type

Also called recursive data types

A recursive type is a type whose definition refers to itself, directly or indirectly, and can represent recursively structured values.

How 2 Manning books explain it

Functional Design and Architecture: Examples in Haskell

A recursive data type is a type whose definition refers to itself, allowing it to represent recursively structured values.

How it is used
Uses recursive types to model lists and keep chains of domain actions under one type.
How deep it goes
Explains recursive list constructors and Free nesting, and sketches how binding extends a chain.
Examples
Illustrates a list of people and a sandwich recipe assembled from nested actions.
What you can do after
Evaluate how recursive definitions represent lists and avoid growing type signatures in action chains.

Read how Functional Design and Architecture: Examples in Haskell explains recursive type →

Elixir in Action, Third Edition

A recursive data structure is a structure whose elements or parts can contain structures of the same form.

How it is used
Explains list representation and performance trade-offs before applying head-tail pattern matching.
How deep it goes
Explains internal head-tail construction, constant-time access, linear updates, and improper-list boundaries.
Examples
Uses nested cons-style expressions, head-tail matches, list updates, concatenation, and a recursive list diagram.
What you can do after
Apply Elixir head-tail syntax to construct, decompose, and reason about list access and update costs.

Read how Elixir in Action, Third Edition explains recursive type →

Also covered in

What to know first

Related concepts

Questions about recursive type

What is recursive type?

A recursive type is a type whose definition refers to itself, directly or indirectly, and can represent recursively structured values.

Which Manning books explain recursive type?

Functional Design and Architecture: Examples in Haskell and Elixir in Action, Third Edition.

What should I know before learning recursive type?

Manning books that teach recursive type usually introduce list, option, Map and tuple first.

What kinds of recursive type are there?

Kinds of recursive type include immutable linked list, list and free monad.

What is recursive type a kind of?

Recursive type is a kind of union type. A union type is a type whose values can represent one of several specified alternative types or variants.

What is recursive type also called?

Recursive type is also called recursive data types.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.