Answers are grounded in this paper and cite their sources.
Experience in teaching functional programming (FP) on a relational basis has led the author to focus on a graphical style of expression and reasoning in which a geometric construct shines: the (semi) commutative square. In the classroom this is termed the “magic square” (MS), since virtually everything that we do in logic, FP, database modeling, formal semantics and so on fits in some MS geometry. The sides of each magic square are binary relations and the square itself is a comparison of two paths, each involving two sides. MSs compose and have a number of useful properties. Among several examples given in the paper ranging over different application domains, free-theorem MSs are shown to be particularly elegant and productive. Helped by a little bit of Galois connections, a generic, induction-free theory for foldr and foldl is given, showing in particular that foldl \, s=foldr(flip x005Fs) holds under conditions milder than usually advocated.
No takes yet. Share an insight, caveat, or question.
José N. Oliveira (2025) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: