A student in my functional programming class is also in the poetry club. The oth...
Andrew K. Hirsch @akhirsch@discuss.systems
A student in my functional programming class is also in the poetry club. The other day, he was late to class because he was working on this:
O Caml! my Caml! our functional program is done,
The variables are immutable, the functions take only one,
The syntax is clear, its elegance revered, its rules designed so plainly,
While follow eyes the consistent types, which ensures you program safely;
But O heart! heart! heart!
O in binary terms of terror,
Where in the terminal my Caml claims,
Failed: type error.
O Caml! my Caml! rise up and fulfill your task;
Rise up—a function recursively done—cleverly pattern matched,
The final case a wildcard—this makes it all exhaustive,
I’ve checked my list; it ends with nil, if it doesn’t than I’ve lost it;
Here Caml! dear function!
Born by your programmer!
It is some dream that in the terminal,
You’ve returned a type error.
My Caml does not budge, the cursor cold and still,
If the compiler could return remorse, its value would be [],
It hath misled, the function name; I am not having fun,
If I could somehow trace my types, the problem would be gone;
Exult O professors, and resolve O piazza posts!
In arrogance thought I be right,
When all along Ocaml knew,
My code was poorly typed.