Programming Languages

Build Systems à la Carte with Effect Handlers

Assigned to Tobias Awotula.

Algebraic effect handlers have been gaining attention in programming language re- search. They offer a new, abstract way of control flow. In this thesis we do a case study on reproducing a Haskell framework for build systems in Effekt, a new programming language with support for algebraic effect handlers.

The goal of this thesis is to showcase Effekt’s features, present a successful repro- duction of the build system framework, and as part of this reproduction, evaluate Effekt’s ability to replace monads and monad transformers with effects and effect handlers.

To do this, first an intuition for algebraic effects handlers is given, together with a short overview of some basic features of Effekt. Then the paper presenting the Haskell framework, “Build Systems à la Carte”, is introduced, and an overview is given over the terms it uses, as well as an overview of the abstractions of its frame- work’s components. Following that, the code of the framework components that are reproduced in Effekt are listed side by side with their original Haskell counterparts, the code is compared against each other and the differences are reasoned about. Finally, the results of the reproduction are discussed.

The major finding of this case study is, that the Haskell build system framework, which heavily relies on monads and monad transformers can be successfully repro- duced in Effekt, with effects and effect handlers replacing monads, monad trans- formers and monadic operations, albeit in its whole, the reproduced components are less versatile due to Effekt’s effects being less polymorph on their parameter types. Additionally, when translating a framework component from Haskell to Effekt, in most cases the quality of minimality is lost.

These findings suggests that perhaps some features should be added to make the Effekt language more versatile and to showcase prominent upsides when replacing monads and monad transformers with effects and effect Handlers.


Philipp Schuster