And about overloading, type checking is nowhere near enough. One frequent example is: What is $(-1)^{1/3}$? You can’t tell right? Similarly in logic, where almost all textbooks carelessly use “$\neg φ$” to mean the formula obtained by adding the logical negation symbol in front of the formula $φ$, resulting in ambiguity all over. For example, what is $\{ φ : \neg φ \in S \}$?

I would say that we cannot complain about people making type errors if we do not ourselves stick strictly to an unambiguous type system. =)

]]>For example 3 ∈ 17 clearly works combinatorically as well as in Finsler’s “generalised numbers”. It’s amusing (at least for me) to try to think of a way to think of a way to do something “backwards” — perhaps in the sense that one looks for a field with one element.

The notion of a prime rectangle could be related to some ambient context perhaps, or some relationship between side-lengths and areas.

Anyway I do agree with you; type errors are a good tool for teachers to identify when a student totally missed the boat.

]]>The list type definition [A] = 1 + A x [A] is fine. I see how that defines 1 to be a list, and any pair of an object of type A together with a list of type A as lists. So for a, b, c of type A i can conclude that 1, (a, 1), (b, (a, 1)), (c, (b, (a, 1)) etc. are of type [A].

However, I don’t see what the recursive definition of the natural numbers Nat = 1 + Nat tells me, except that 1 is of type Nat. Since for any type A, if 1 is of type A it holds that A = 1 + A, since any object of type A is either 1 or any other object of type A. I don’t see how this is supposed to define the type of natural numbers, when the notion of taking successors is not even mentioned. In Haskell, we can define natural numbers as “data Nat = Zero | Succ Nat” where Succ is the type constructor modelling “taking the successor”, but in your description this doesn’t appear.

What am I missing here?

]]>