I read a recent Functional Pearl by Hinze and this inspired me to write up an example of projective programming and its motivation in logic/model theory.
This post was inspired by a curious
question on
Twitter: is curry or uncurry more common in Haskell code?
You may have seen my post on co-(Elgot algebras),
in which I mentioned I had been using some exotic recursion schemes for my
gmpint package. I came across a similar example, this time for Mendler-style
recursion schemes. To my knowledge, it is the only published example of
a Mendler-style catamorphism.
Suppose we wish to convert a number to its base \( b \) representation. GMP uses arrays of limbs to represent large integers; we need to tease out its base \( 2 ^{64} \) representation.
prev