The Scala Workshop 2025
Mon 13 - Tue 14 October 2025 Singapore
co-located with ICFP/SPLASH 2025
Mon 13 Oct 2025 11:45 - 12:05 at Peony West - Morning Chair(s): Oliver Bračevac, Hamza Remmal

Although pure functional programming can express many abstractions cleanly and succinctly, certain algoithms are better written imperatively. These algorithms require mutation to be efficient and/or more concise. In response, functional languages have developed techniques for delimiting where mutation can occur while still permitting results to be communicated between pure and impure portions of a program. To maintain purity, however, these techniques typically prevent data structures created impurely from escaping into pure portions, severely impeding the construction of complex objects. The standard workaround relies on the builder pattern. Unfortunately, this approach incurs runtime overhead and leads to code duplication.

In this talk, we present a technique for encoding objects and data structures in a language with subtyping and singleton types so that they are mutable any way you want it only where you want it. The essence of our idea is to only allow mutation on an object where the corresponding capability object is present, which we enforce using singleton types reminiscent to how Launchbury and Jones [1994] enforce purity using rank-2 polymorphic types. As a result, one can notionally “take away” the part of an object’s API that causes mutation by rescinding the capability, thus allowing in-place construction without dedicated builders. We have implemented our technique in Scala with only minimal changes to its compiler, thereby showing that our encoding is lightweight and interoperable with existing impure programs.

Slides (mutation_slides.pdf)3.56MiB

Mon 13 Oct

Displayed time zone: Perth change

10:50 - 12:05
MorningThe Scala Workshop 2025 at Peony West
Chair(s): Oliver Bračevac EPFL, LAMP, Hamza Remmal EPFL, LAMP
10:50
10m
Day opening
Welcome to Scala'25
The Scala Workshop 2025
Oliver Bračevac EPFL, LAMP, Hamza Remmal EPFL, LAMP
11:00
45m
Keynote
Simpler Scala Builds with Functional and Object-Oriented Programming
The Scala Workshop 2025
K: Li Haoyi Independent
11:45
20m
Talk
Taking away Mutation
The Scala Workshop 2025
Edward Lee University of Waterloo; University of Toronto Scarborough, James You University of Waterloo, Dimi Racordon EPFL, LAMP, Ondřej Lhoták University of Waterloo
File Attached