I’ve posted a set of Haskell modules I’m calling Category Extras. Over the past few weeks, I’ve been diving into Category Theory, which is one of those fundamental unifying mathematical thingys. At this point, I’ve learned enough that I no longer find it incomprehensible—merely baffling.
Anyhoo, it turns out that a lot of categorical notions can be
applied to programming languages. In particular, the
Monad classes come directly from category theory.
(I’ve put some notes about functors up at the Haskell wiki.)
Category Extras is a side-effect of my learning process. As I picked stuff up, I often would write or copy code demonstrating the ideas. This package is a collection of the more generic parts.
Documentation is sparse right now. In particular, I want to add
some acknowledgements to the recursion combinators documentation,
as a lot of it comes from the paper Recursion schemes from
comonads by Tarmo Uustalu, Varmo Vene, and Alberto Pardo.
In particular, they came up with the generalized catamorphism I
foldWith in the module.
On the other hand, I haven’t seen the generalized apomorphism
g_apo) or generalized, monad-parameterized anamorphism (
in my brief survey of the material. (Wouldn’t it be cool
if they were original to me? But I doubt that’s possible.)
Since most of the code consists of obvious implementations of ideas thought up by others, I’m tentatively releasing it into public domain. Not that it would do anyone much good. I mean, how often do you need to use a comonad?