Identity Types
Previously: Models of (Dependent) Type Theory. There is a deep connection between mathematics and programming. Computer programs deal with such mathematical objects as numbers, vectors, monoids, functors, algebras, and many more. We can implement such structures in most programming languages. For instance, here’s the definition of natural numbers in Haskell: data Nat where Z :: Nat -- zero S :: Nat -> Nat -- successor There is a problem, though, with encoding the laws that they are supposed t