Monads are not what they seem
Computer science provides an in-depth understanding of technical and mathematical aspects of programming concepts such as monads, but there is more to monads. If we want to understand how programming concepts evolve, how programmers think about them and how they are used in practice, we need to consider a broader perspective that includes historical, philosophical and cognitive aspects. In this paper, we develop such broader understanding of monads -- a programming concept that got into programming from category theory, has language support in several languages and has a reputation for being elegant and powerful, but also intimidating and difficult to understand. We review the history of monads in the context of programming and study the development through the perspectives of philosophy of science and mathematics, as well as cognitive sciences.
We develop a framework for understanding programming concepts that considers them at three levels: formal, metaphorical and implementation. Our observations are based on established results about the scientific method and mathematical entities -- cognitive sciences suggest that the metaphors used when thinking about monads are more important than widely accepted, while philosophy of science explains how the research paradigm from which monads originate influences and restricts their use. Finally, we provide evidence for why a broader philosophical, sociological look at programming concepts should be of interest for programmers. It lets us understand programming concepts better and, fundamentally, choose more appropriate abstractions as illustrated in a number of case studies that conclude the paper.
Draft and more information
- Download the draft paper (PDF)
Comments are welcome!
Published: Friday, 1 December 2017, 12:00 AM
Author: Tomas Petricek
Typos: Send me pull request!