Controlling program flow with capabilities in Scala
nrinaudo.github.io·16h·

The full code for this article can be viewed here.

Introduction

I’ve written about capabilities before, but only presented very simple ones, ones that do not impact the program flow in any way.

This article intends to fix this by exploring how to jump around in a program, short-circuiting computations as and when necessary. This is a powerful tool that we’ll bring to bear to make code that can be a little thorny in a monadic style quite clear in a capabilities-backed direct style, without loosing the properties we care about.

Sequencing data

The example we’ll be using is sequencing, the fancy name for *flipping type co…

Similar Posts

Loading similar posts...