3 ms·
Well, I'm convinced! No more cons lists for me. There are other benefits to programming techniques built around general catamorphisms, too! For instance, by ab
by camccann 17y ago
Well, I'm convinced! No more cons lists for me.
There are other benefits to programming techniques built around general catamorphisms, too! For instance, by abstracting all recursion into the catamorphism framework, the destructor function that does all the heavy lifting can often be easily expressed in a subset of the language that contains only total functions (that is, functions that always produce a valid result in finite time), allowing (comparatively) simple proofs of correctness.
This also pairs well with the mirrored approach of building (potentially infinite) data in an "on demand" manner. Abstracting the corecursion into the anamorphism likewise allows the constructor functions to often be total.
Turing-completeness is overrated!
- TheSOB88 17y agoThat was so far over my head I'm not even sure I have a head anymore.