Skip to content

About

Slides and examples for the Scala Days 2026 talk "First-class Logical Refinement Types for Scala"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

First-class Logical Refinement Types for Scala

Slides and examples for the Scala Days 2026 talk by Matt Bovel (EPFL).

Examples

dotty-examples/ contains every example from the slides, plus a few more. Each file runs on its own with Scala CLI:

scala --cli-version 1.18.0 run dotty-examples/02_fansi.scala

Lines marked // error are commented out because they are expected not to compile; uncomment one to see the error message. dotty-examples/check.sh compiles every file and checks that each // error line indeed fails; CI runs it on every push.

To use refinement types in your own project, add these directives to your file:

//> using scalaOrganization ch.epfl.lara
//> using scala 3.10.1-RC1-bin-20260903-e1f9361-NIGHTLY
//> using options -language:experimental.qualifiedTypes

or, with sbt, in build.sbt:

scalaOrganization := "ch.epfl.lara"
scalaVersion := "3.10.1-RC1-bin-20260903-e1f9361-NIGHTLY"
scalacOptions += "-language:experimental.qualifiedTypes"

Verifying with Stainless

stainless-examples/ contains examples verified by Stainless, which checks refinement types with SMT solvers. install.sh installs a pinned Stainless release (with z3 and cvc5) into .stainless/:

./install.sh
.stainless/stainless stainless-examples/sum.scala stainless-examples/merge_sort.scala

The files also compile with Scala CLI, in silent mode, once Stainless is installed (merge_sort.scala uses the Stainless library from .stainless/).

Building the slides

The slides are written in presentation/presentation.md. presentation.html and presentation.pdf are committed; to rebuild them (requires Docker):

cd presentation && make

About

Slides and examples for the Scala Days 2026 talk "First-class Logical Refinement Types for Scala"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages