io7m | single-page | multi-page | archive (zip, signature)
A Crash Course In Algebraic TypesA Crash Course In Algebraic Types2. Why?
PreviousUpNext

Overview
This document attempts to describe so-called algebraic data types, and the language construct - pattern matching - used to manipulate them in functional languages.
The document assumes very little in the way of prior knowledge of type systems and attempts to be light on mathematics and theory. The document is aimed at people with a passing interest in static type systems, and also at authors of new programming languages. It is also likely of interest to users of existing statically typed languages who are curious as to what newer languages have to offer.
The example code is written in both Java and Haskell, but the types described are present in many other systems and usually only differ in terms of syntax as opposed to theory.

PreviousUpNext
A Crash Course In Algebraic TypesA Crash Course In Algebraic Types2. Why?