thoughtworksinc / zerocost.scala

Zero-cost Abstractions in Scala

GitHub

ZeroCost.scala

ZeroCost.scala is a collection of data-structures that have zero memory overhead. All those data-structures are opacity aliases, exposing their features via static methods and cats type classes.

Unlike value classes, our ZeroCost types never box/unbox, resulting in better performance and zero memory overhead, especially when using those types in tuples and collections.