Re:JEP draft: Exception handling in switch
by bedobi on Friday April 19, 2024 @01:56PM
(#40089981)
I don't mean to be uncharitable but no, that's not how it works. You pass the Either<Error, Foo> or Maybe/Option<Foo> around, usually to the edge of the system where you map, flatMap or fold it into something.
[ Parent
| on HN ]
Re:JEP draft: Exception handling in switch
by codedokode on Saturday April 20, 2024 @11:25AM
(#40098066)
But this is ugly, for example, if I have a square root function, I don't want it to accept Error.