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