Hello:
I found a reference on the internet to a puzzle posed by Bruce Duba.
The challenge is to define Nil and Cons to make the following type
check:
fun length (Nil) = 0
| length (Cons (_, x)) = 1 + length (x);
val heterogeneous = Cons (1, Cons (true, Cons (fn x => x, Nil)));
I banged my head against this problem for a while, and nothing seems
to come up. Can someone please give me a hint here?
Thanks,
Mayer