
TL;DR
This paper revisits design patterns in the context of functional programming, demonstrating how Rust's type system can encode domain concepts to improve correctness and expressiveness.
Contribution
It introduces a new approach to design patterns tailored for functional languages, exemplified by four patterns implemented in Rust to enhance compile-time safety.
Findings
Rust implementations effectively model domain concepts
Type systems can catch errors at compile-time
Enhanced pattern expressiveness in functional programming
Abstract
This paper explores how design patterns could be revisited in the era of mainstream functional programming languages. I discuss the kinds of knowledge that ought to be represented as functional design patterns: architectural concepts that are relatively self-contained, but whose entirety cannot be represented as a language-level abstraction. I present four concrete examples embodying this idea: the Witness, the State Machine, the Parallel Lists, and the Registry. Each pattern is implemented in Rust to demonstrate how careful use of a sophisticated type system can better model each domain construct and thereby catch user mistakes at compile-time.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
