Re:Applying “make invalid states unrepresentable”
by nybble41 on Monday October 05, 2020 @11:48AM
(#24688800)
I'm not sure you would consider this a good way, but one can implement (unchecked) sum and product types in any language with lexical closures via Scott encoding[1]:
[1] https://en.wikipedia.org/wiki/Mogensen%E2%80%93Scott_encodin...
[ Parent
| on HN ]