Faking ADTs and GADTs in Languages That Shouldn't Have Them Posted by mstksg@reddit | programming | View on Reddit | 2 comments
[-] davidalayachew@reddit Didn't finish reading, but you mentioned that Java had sealed types to represent Sum Types. Well, Java now has record to represent Product Types. Your Transaction example melts down to this. record Transaction(long timestamp, double amount) {/* your stuff here */}
[-] anzu_embroidery@reddit As a Haskell-brained individual I support all efforts to extend the warm blanket of type-level logic across the unwashed masses
davidalayachew@reddit
Didn't finish reading, but you mentioned that Java had sealed types to represent Sum Types.
Well, Java now has
record
to represent Product Types. YourTransaction
example melts down to this.anzu_embroidery@reddit
As a Haskell-brained individual I support all efforts to extend the warm blanket of type-level logic across the unwashed masses