Media Summary: More about records vs. variants, and how variants can combine "one of" vs "each of" data. Textbook: ... An extended example of developing an ADT. Textbook: The formal syntax and semantics of lists. Textbook:
Options Ocaml Programming Chapter 3 - Detailed Analysis & Overview
More about records vs. variants, and how variants can combine "one of" vs "each of" data. Textbook: ... An extended example of developing an ADT. Textbook: The formal syntax and semantics of lists. Textbook: How to define some common operators for function application, including the pipeline operator Textbook: ... How to make variants be recursive, and how to parameterize them on other types. Textbook: Examples of variants, which along with records are the primary kind of user-defined data types in
Using pattern matching to access the pieces of a variant. Textbook: The formal syntax and semantics of pattern matching. Textbook: Examples of pattern matching with lists, records, and tuples. Textbook: In this tutorial, I will show the basic ideas of immutable lists (cons lists), as well as polymorphic functions that operate over lists. The formal syntax and semantics of variants. Textbook: How to raise exceptions, which are really variants. Textbook:
The `function` keyword provides helpful syntactic sugar for pattern matching. Textbook: How to handle exceptions with `try` and pattern matching. Textbook: