2 ms·
Sum types are the right thing for a statically typed language. Returning an error and a value as a product type with an implicit promise to ignore the value pa
by JonChesterfield 3y ago
Sum types are the right thing for a statically typed language.
Returning an error and a value as a product type with an implicit promise to ignore the value part if the error part has a specific value is not the right thing.
There's a credible chance sum types are the right thing in a dynamically typed language too but I haven't settled on exactly what what should look like yet. It's not a thing in the dynamic languages I know of.