Making sense of adjunctions

When I first encountered the concept of an adjunction, I got quite confused as to what it is, and why it is useful: Just how on earth is a left adjoint of a functor? What’s the matter of a free and forgetful functor, why is free left to forgetful but not the other way round. That’s where this blog comes from. I hope this blogpost can help demystify adjunction for you a little bit....

<span title='2023-11-03 19:53:38 +0000 UTC'>November 3, 2023</span>&nbsp;·&nbsp;Shuntian Liu

Monad in programming and category theory

This article is very much my attempt to understand monad as a design pattern in programming languages and why on earth it is useful. There are tons of monad tutorials online, but I found relatively few ones argue for the usefulness of a monad by having side by side code examples that achieve similar functionalties. If you found one, please do let me know! I try to draw connections between monads’ original mathematical definition and its actual usage so that this mysterious concept does not come out of the blue....

<span title='2023-10-24 23:48:44 +0100 +0100'>October 24, 2023</span>&nbsp;·&nbsp;Shuntian Liu

Hypermnesia: Eventual Consistency in Mnesia

Motivation Mnesia is a soft real-time embedded Database Management System written for Erlang, a programming language that powers the infrastructures of various organisations such as Cisco, Ericsson and the NHS. Due to Mnesia’s tight integration with Erlang, it is also impactful in open source projects such as RabbitMQ and ejabberd. However, the development of Mnesia has remained stagnant for years, resulting in the lack of features such as automatic conflict resolution: Mnesia leaves the handling of conflicts after network partitions entirely to the developer....

<span title='2023-06-06 19:26:33 +0100 +0100'>June 6, 2023</span>&nbsp;·&nbsp;Shuntian Liu

Erlog: A Distributed Datalog Engine

Introduction In this blogpost we build a distributed datalog engine that can process datalog queries such as the one below in a distributed fashion. The key idea mimics the usual dataflow programming idea such as MapReduce where we shard our data and create a dataflow-graph to specify the computation we want. link("a","b"). link("b","c"). link("c","c"). link("c","d"). link("d","e"). link("e","f"). reachable(X, Y) :- link(X, Y). reachable(X, Y) :- link(X, Z), reachable(Z, Y). We will build our engine from first principle by looking at how we perform single node evaluation of datalog queries, and then extend it to multiple nodes....

<span title='2023-04-16 19:53:43 +0000 UTC'>April 16, 2023</span>&nbsp;·&nbsp;Shuntian Liu

Equivalence of proof techniques in proving the fixpoint properties

Denotational Semantics is a unique course offered by the Computer Lab at UoC. It can be intimidating at first glance but at the same time bring you lots of fun and frustration at the same time. In this blog post we will look at three proof techniques in domain theory and investigate the connections between them. In this blog we look at three techniques that can be used to prove the fixpoint of a function, namely, Tarski’s fixpoint theorem, lfp1 + lfp2 and Scott induction....

<span title='2022-06-30 08:59:42 +0100 +0100'>June 30, 2022</span>&nbsp;·&nbsp;Shuntian Liu