Patterns in Functional Programming
While software design patterns were originally developed in object-oriented programming, subsequent work has sought to uncover structures that apply to functional programming. This book explores the recurring patterns of computation that arise in diverse and distinct programs. These patterns relate the shape of data with the shape of programs that manipulate such data. By learning about these patterns, readers gain insight into program construction and become better equipped to design, extend, and modify software and languages. Following a self-contained introduction to tools from algebra and category theory, these tools are used to provide a framework for explaining what patterns are. The text is presented in concise, digestible chapters. Exercises and complete solutions are provided throughout to aid understanding, with the final part covering a series of extended examples. This is an essential resource for graduate students and professionals who want to better understand how programs are constructed.
- Explains the principles of mathematically structured functional programming, drawn from algebra and category theory
- Helps readers to better understand the structure of their programs, and therefore assists them in designing and manipulating those programs
- Provides exercises throughout, with complete solutions, as an ideal resource for graduate students, researchers, and professionals
Product details
- Published: February 2027
- Format: Hardback
- ISBN: 9781108836388
- Length: 629 pages
- Dimensions: 244 × 170 mm
- Availability: Not yet published - available from February 2027
Table of Contents
- Part I. Introduction:
- 1. Functional programming
- 2. Structure in programs
- 3. The mathematics of program construction
- Part II. Fundamentals:
- 4. Algebraic structures
- 5. Category theory
- 6. Functors and natural transformations
- 7. Products and coproducts
- 8. Adjunctions
- 9. Extreme solutions
- 10. Monads
- 11. Monoidal categories
- Part III. Datatypes:
- 12. Lists
- 13. List homomorphisms
- 14. The theory of lists
- 15. Data and codata
- 16. Primitive recursion
- 17. Continuous algebras
- 18. Hylomorphisms
- 19. Recursive coalgebras
- Part IV. Effects:
- 20. Monadic programming
- 21. Combining monads
- 22. Algebraic theories
- 23. Idioms
- 24. Idiomatic traversals
- 25. Staging
- 26. Comonads
- Part V. Generics:
- 27. Datatype-generic programming
- 28. Derivatives
- 29. Monadic recursion
- 30. Metamorphisms
- 31. Accumulations
- 32. Adjoint folds
- Part VI. Applications:
- 33. Program fission
- 34. Sorting
- 35. Enumerating the rationals
- 36. Primes
- 37. Continued fractions
- 38. The digits of 𝝅
- 39. Arithmetic coding
- 40. Asymmetric numeral systems
- 41. Maximum segment sum revisited
- Appendix. Haskell
- References
- Index
- Envoi.
- Show more