2017-10-06: Peter Hancock

Tue, 14 Oct 2025 16:51:42 +0000

Peter Hancock

Tetration

Abstract

In ghci, you can write something like
let two f = f . f in two two two two (+1) 0
and it will print "65536". If you write something like
let two f = f . f ; four = two . two in four ($ two) id (+1) 0
it will print "Occurs check: cannot construct the infinite type: a ~ a -> a".

Can haskell not count to four?(*)

The topic is the compact representation of unfeasibly large numbers using a pure (Glaswegian?) universe. Some excursions into the hinterland of the topic are likely.

By the way, tetration is the function m n |-> n ^ .. ^ n with m n's.

(*) No doubt mad haskell mambo or pragma exists that will trick it into counting up to four. I will reward the most amusing/revolting demonstration with a large (reasonably priced) malt whisky.

2017-10-06 16:00:00 UTC
LT1310