Code snippets and technical notes
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 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, …
PureScript has no subtyping. Data constructors are not subtypes; they are functions that build values of a single type. When you need to share structure across types, row polymorphism provides a more …
An excellent tool when you need to troubleshoot distributed systems is ss, which provides visibility into TCP states of your live connections. Even if you know netstat this is a command you should get …
Profunctors are the abstraction that makes lenses, prisms, and other optics composable. This article builds intuition for profunctors from first principles, showing how they generalize the familiar …
Notation conventions The following table provides a quick overview of conventions used in symbolic operators in the lens library. Symbol Concept Denotes ^ getter gets value from structure ~ setter …
Prerequisites wget is installed tar is installed Purpose If you really don't want to install Nix under /nix (or you can't) then you can install Nix in your home directory like in the …
I am hoping this will serve as a reference for coworkers and others new to Erlang and OTP to be able to figure out the terminology easier than I had to. I learned the hard way, so you don't have …
Here is a snippet showing how to use the Meck API which is a mocking library in Erlang. We will show how to create a fully mocked version of an existing module, unloading mocks, removing functions …
Updated for Python3 recently: class Predicate: """ Define predicate algebra. >>> isEven=Predicate(lambda x: x % 2 == 0) >>> isOdd=Predicate(lambda x: x % 2 == 1) …