Typed Design Patterns for the Functional Era

07/13/2023
by   Will Crichton, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/25/2018

Induction, Coinduction, and Fixed Points: A Concise Survey

In this survey paper (which hitherto is an ongoing work-in-progress) we ...
research
04/01/2021

Immutability and Design Patterns in Ruby

Functional Programming has seen a resurgence in interest in the last few...
research
05/16/2019

First-Class Subtypes

First class type equalities, in the form of generalized algebraic data t...
research
06/22/2022

Functional or imperative? On pleasant semantics for differentiable programming languages

In machine learning (ML), researchers and engineers seem to be at odds. ...
research
01/14/2018

Hierarchical Memory Management for Mutable State

It is well known that modern functional programming languages are natura...
research
07/17/2017

FabULous Interoperability for ML and a Linear Language

Instead of a monolithic programming language trying to cover all feature...
research
09/05/2018

Covariance and Controvariance: a fresh look at an old issue (a primer in advanced type systems for learning functional programmers)

Twenty years ago, in an article titled "Covariance and contravariance: c...

Please sign up or login with your details

Forgot password? Click here to reset