"Duality" is the idea that two concepts are "similar but opposite" in some precise sense. The discovery of a duality enables us to use our understanding of one concept to help us understand the dual concept, and vice versa. It is a powerful technique in many disciplines, including computer science. In this episode of the Haskell Unfolder we discuss how we can use duality in a very practical way, as a guiding principle leading to better library interfaces and a tool to find bugs in our code.
This episode focuses on design philosophy rather than advanced Haskell concepts, and should consequently be of interest to beginners and advanced Haskell programmers alike (we will not use any Haskell beyond Haskell 2010). Indeed, the concepts apply in other languages also (but we will assume familiarity with Haskell syntax).
Further reading:
* Wikipedia has a list of dualities across many disciplines:
en.wikipedia.o...
* Dagstuhl seminar 13311 was dedicated to the study of (more precise) dualities in computer science.
www.dagstuhl.d...
References for the examples of duality shown in the introduction:
1. en.wikipedia.o...
Yin Yang symbol
Attribution: Klem - This vector image was created with Inkscape by Klem,
and then manually edited by Mnmazur.
2. en.wikipedia.o...
Photo of a page from the Yijing
Attribution: Franklin Perkins in "Leibniz and China: A Commerce of Light"
3. iep.utm.edu/du...
Duality in logic.
Attribution: Lorenz Demey and Hans Smessaert
4. onlinelibrary....
Duality in electronic circuit design.
Attribution: David F. Peelo. "Current Interruption Transients Calculation"
(appendix B: Principle of Duality)
5. en.wikipedia.o...
Dual graphs in mathematics.
Attribution: wikipedia.
6. • But what is the Fourie...
"Almost-fourier transform".
Attribution: 3Blue1Brown (Grant Sanderson): "But what is the Fourier
Transform? A visual introduction"
7. • The Haskell Unfolder E...
Duality of `fold` and `unfold` in Haskell.
Attribution: The Haskell Unfolder Episode 24: generic (un)folds
20 сен 2024