What is cosh(List(Bool))? Or beyond algebra: analysis of data types.
cofault.com·28w·
🔤Type Theory
Preview
Report Post

What is cosh(List(Bool))? Or beyond algebra: analysis of data types. There is that curious idea that you can think of a type in a programming language as a kind of algebraic object. Take (homogeneous) lists for example. A list of integers is either an empty list (i.e., nil) or a pair of an integer (the head of the list) and another list (the tail of the list). You can symbolically write this as

$$\List(\integer) = 1 + \integer \cdot \List(\integer)$$

Here (1) is the unit type with one element, it does not matter what this element is exactly. (A + B) is a disjoint sum of (A) and (B). It is a [tagged union](h…

Similar Posts

Loading similar posts...