Homomorphisms: The Maps Between Structures
A homomorphism preserves structure. fold is the universal homomorphism from the free monoid. This is the algebraic reason that fold, evaluation, and parallelism work.
Tag archive
A homomorphism preserves structure. fold is the universal homomorphism from the free monoid. This is the algebraic reason that fold, evaluation, and parallelism work.
The free monoid on a set is the type of lists over that set. The universal property says fold is the unique homomorphism from lists to any monoid. This explains why lists, multisets, and polynomials appear everywhere.
The Russian peasant algorithm computes products, powers, Fibonacci numbers, and more, once you see the underlying algebraic structure.
Online accumulators are monoids. Default construction is the identity, combination via += is the binary operation, and parallel composition gives the product monoid, computing arbitrary statistics in a single pass.
A reflection on eleven explorations in generic programming, and how algorithms arise from algebraic structure.
With the advent of Ractor and Fibers we've hit the limits of mutable types. We're going to need some new patterns, and with that comes some interesting observations on the nature of parallel structures.
Disclaimer: I am not a mixologist. This is not professional cocktail advice! Sam Horvath-Hunt...
One of the nice things about the succinct ways we have in Haskell for writing functions is that our...