Integration as Composition
Code: Chibrary, composition, design, functional programming, literate programming, pointfree
I’m puzzling over the design for a worker and would appreciate your comments on it. I started with the pain of an ugly test, made an interesting refactoring, and decided to drop the test entirely, but I’m not at all sure this is the right decision.
In my mailing list archive Chibrary, I want to sum up the number of threads and messages in a month to present on archive pages. The
MonthCountWorker takes a
Sym, a unique identifier for a list’s slug + year + month, fetchs the threads for that month, sums them, and stores the sum. The code is trivial, right?:
Functional Package Management
Code: functional programming, nix, nixos, system administration
I just read a great paper about NixOS, a Linux distribution with a “purely functional” package manager. I’ve been thinking about the parallels between programming and system administration, and this is a brilliant use of the comparison. They created a package manager named Nix where all packages are built and maintained independently even of other versions of themselves.
I’m reading Programming Ruby: 2nd Ed. and an example on page 57 has captured my attention. (Code slightly modified for brevity)