Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Functional Programming – 16: ADT, Pattern Matching demo

5.5K views on YouTube

Algebraic data type or ADT is a composite type. There are two common kinds of composite types: Product Type and Sum Type. A Product Type keeps values for each initial type. A Sum Type keeps only one value but that value can be from any of its initial types.
Pattern Matching is the process of matching and extracting data from composite type values.
In this video you will learn how to Pattern Match on Option, Either and List, and in the end we will take a quick look at TypeScript library called “ts-pattern” to do Pattern Matching.

In this Video:
– Algebraic Data Type (ADT)
– Product Type
– Sum Type
– Pattern Matching on Option
– Pattern Matching on Either
– Pattern Matching on List
– TS-Pattern

Links:
– TS-Pattern – https://github.com/gvergnaud/ts-pattern