Both of those (sum and products) are ADTs.
Both. Java has records for products, sealed hierarchies for sums, and offers pattern matching over them. See https://www.infoq.com/articles/data-oriented-programming-jav...
Re:Guide to Java Virtual Threads
by DeathArrow on Friday March 17, 2023 @05:44AM
(#35194998)
>sealed hierarchies for sums
I wouldn't call that a good example of sum types. You can use sealed classes or other mechanism in C# to emulate sum types. I was thinking about something built in the language.
Example:
type IntOrBool = | I of int | B of bool
>That's how we've been able to avoid properties and just have algebraic data types By algebraic data types you mean product types or sum types?