Weblog of Justin Le, covering various adventures in programming and explorations in the worlds of computation physics, and knowledge.| in Code
Everybody Loves My Baby is a Jazz Standard from 1924 with the famous lyric: Everybody loves my baby, but my baby don’t love nobody but me. Which is often formalized as: \begin{align} \text{Axiom}_1 . & \forall x. \text{Loves}(x, \text{Baby}) \\ \text{Axiom}_2 . \forall x. & \text{Loves}(\text{Baby}, x) \implies x = me \end{align} Let’s prove in Haskell (in one line) that these two statements, taken together, imply that I am my own baby.| in Code
Welcome back to our journey through the singleton design pattern and the great singletons library! This post is a direct continuation of Part 1, so be sure to check that out first if you haven’t already! If you hare just jumping in now, I suggest taking some time to to through the exercises if you haven’t already! Again, code is built on GHC 8.6.1 with the nightly-2018-09-29 snapshot (so, singletons-2.5). However, unless noted, all of the code should still work with GHC 8.4 and singletons...| in Code