Michael Perruca - Constraint Typing with Boolean Algebra | Scala Days 2023 Seattle

Просмотров: 383   |   Загружено: 2 год.
icon
Scala Days Conferences
icon
19
icon
Скачать
iconПодробнее о видео
Constraint Typing with Boolean Algebra

Primitive types often don’t convey enough constraints to call functions safely. Scala 3 features enable additional constraint specification on data types in a composable way, without needing to change data types as previously experimentally with in systems based on smart constructors or tagging.

Under-constrained data specification leads to runtime errors that bypass the static type checker. Refinement types attempt to fill this gap, but common implementation approaches to refinement types in Scala haven’t been entirely satisfying. Smart constructors and tagging types both require separate data types. This leads to inelegant solutions for mutually dependent constraints and type class interoperability.

Scala 3’s new features, such as union and match types, enable a composable constraint system supporting the full breadth of Boolean algebra. These constraints can be user-defined and are evaluated either at runtime or compile time through inlining as specified by the caller.

Michael Perucca
Lucid Software

I’m a software engineer at Lucid Software interested in how programming techniques affect our ability to design correct programs.

Похожие видео

Добавлено: 55 год.
Добавил:
  © 2019-2021
  Michael Perruca - Constraint Typing with Boolean Algebra | Scala Days 2023 Seattle - RusLar.Me