Algebraic Data Types + Pattern Matching = Elegant and readable Java code
A talk that starts with a problem and ends up with an elegant implementation using Java's records, sealed types and pattern matching. It's all live coding!
Project Amber is bringing lot of exciting features to Java. Records, sealed types and many pattern matching features are few important ones. Sealed types and records are the mechanisms to create sum- and product-types respectively. These are two important forms of ADT (Algebraic Data Types). Using ADT along with pattern-matching, we can create APIs that are hard to misuse and create programs that are easier to read.
All in all, in the talk we start with a problem statement and a list of requirements and then we create an implementation step-by-step by introducing requirements one by one. While we do that we make use of records, sealed types and pattern matching in Java to create elegant solution with highly readable code.Level:Intermediate