Skip to content

Introducing tagless-final in Scala with an example of Language-Integrated Query

Notifications You must be signed in to change notification settings

hablapps/tagless-final-tutorial

Repository files navigation

Tagless-final, or abstraction without guilt

This repository offers an introduction to the tagless-final approach, as well as a comparison with alternative approaches - the MTL style, in particular. The introduction is largely based on the following two papers:

The material is structured around a number of variations on a theme of Language-Integrated Query. In particular, we will focus on six different ways to perform a query in Scala over a relational database:

Each variation exposes the solution to the problem, and both its advantages and disadvantages. These are mainly framed in the trade-offs between modularity and efficiency conveyed by the use of the different techniques. Tagless-final is presented as one of the techniques to achieve abstraction, without sacrifying efficiency.

Set-up

Throughout this introduction, we will play with the world database used in the documentation of doobie, a most convenient JDBC wrapper for Scala. You can find instructions here for the set-up of a postgres database server and the installation of the world database. The script common.sc contains several utilities as well as a ready-to-use doobie transactor for issuing SQL queries to the world database.

Presentations

About

Introducing tagless-final in Scala with an example of Language-Integrated Query

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published