Data

In this chapter, we'll examine some of OCaml's built-in data types, including lists, variants, records, tuples, and options. Many of those are likely to feel familiar from other programming languages. We'll learn about pattern matching, which is a feature that's less likely to be familiar.

Then we will see how we can define our own algebraic data types, and how many of OCaml's built-in data types would not have to be built-in, but are actually definable with algebraic data types.

We'll also examine how to define data types for trees and maps using various combinations of the above features.

results matching ""

    No results matching ""