Why folks use <> for same-type composition
19 Jul 2020 ⇐ Notes archive(This is an entry in my technical notebook. There will likely be typos, mistakes, or wider logical leaps — the intent here is to “let others look over my shoulder while I figure things out.”)
A wondering I had back when I started studying FP in earnest was why folks used <>
for same-type composition instead of the more general >>>
operator (which stitches (A) -> B
s with (B) -> C
s).
And yesterday while re-watching Brandon Williams’ “Monoids, predicates and sorting functions” talk, I found a likely answer (timestamped link).
Functions in the form (A) -> A
— endomorphisms — come with a semigroup (and monoidal) structure and the diamond operator is a nod to that. The operator is subtly interchangeable with >>>
because Endo
’s1 conformance leans on function composition under the hood.
-
The nominal veneer often used over the non-nominal
(A) -> A
type. ↩