Lazily consuming a self-referential linked list
Haskell Community [Unofficial]
May 25, 2026
yanhu:
If you tease the type a bit you end up with a co-algebra:
Thanks for all the fancy words, made me look up and learn what (co-)algebras are.
yanhu:
What you have then described seems to be a at least a monadic anamorphism
This is roughly where I got lost, what is a monadic anamorphism?
yanhu:
Mind if you share your new definitions of
WorkList.runand friends?
Not at all, you can find the entire source code in the git repository.
The base definition is very involved, because I added support for Prioritizable Tasks:
WorkListT (click for more details)
But all the type tetris is not visible anyway unless you need to build something custom, the interface for the standard WorkList is not nearly as parametric:
Discussion in the ATmosphere