Functional Programming
Flix Part 2: Smart Constructors
Smart constructors validate data at construction time, preventing invalid states from existing. This article compares smart constructor patterns in Flix and Scala 3, showing how each language encodes …
A Haskell view of functional programming ("effectful")
This article explores Haskell’s techniques for isolating side effects, starting with the IO monad, which encapsulates impure code to enable reasoning about pure portions. It explains IO’s …
A Haskell view of functional programming (well-typedness)
Dive into an educational journey exploring the power of strong static typing, enforcing domain-specific constraints, and ensuring the validity of values. Uncover how well-typedness enhances code …
Flix Series Part 1: Higher-order functions & infix combinators
This article delves into the world of functional programming with the Flix programming language with higher-order functions and user-defined infix operators.
Flix Series Part 0: Getting Started & Setup
Are you ready to embark on a coding adventure with Flix? This article introduces Flix, a programming language that combines the best features of functional languages like Scala and Haskell. But …
Profunctors for Practitioners: The API (Part 3)
Part 3 examines the Profunctor typeclass in detail: the dimap operation, its laws, and the Strong and Choice extensions that enable profunctors to work with products and sums. These building blocks …
Profunctors for Practitioners: First Intuitions (Part 2)
Part 1 showed paired operations like encode/decode and serialize/deserialize. Part 2 builds the intuition for why these pairs fit together: one direction produces data (covariant), the other consumes …
Profunctors for Practitioners: Motivating Examples (Part 1)
Software development involves many paired operations: encoding and decoding, serializing and deserializing, encrypting and decrypting. Profunctors capture this pattern. Part 1 introduces the …
Dhall's merge: Pattern Matching for Configuration
Dhall's merge function provides exhaustive pattern matching for union types. This article shows how merge works, from simple enumerations to union types with payloads, with comparisons to Haskell …
Reader: Dependency Injection Without the Ceremony
Reader is a pattern for threading read-only configuration through a computation without passing it as an argument at every call site. This article builds Reader from first principles in PureScript, …