4 ms·
It certainly can be a pain in some languages but modern functional languages (Scala and Haskell come to mind) it is actually really easy and clean. I would real
by thinkharderdev 6y ago
It certainly can be a pain in some languages but modern functional languages (Scala and Haskell come to mind) it is actually really easy and clean. I would really not want to use the Either[Error,Result] pattern in Java but that is more a limitation of the Java language than the basic pattern
- saurik 6y agoHaskell has monads, which allow you to define the propagation behavior of Either and then hide the syntax overhead behind do notation. Using the data type of Haskell error handling--which exists in an ecosystem of monads... a way of defining the interaction of sequential code and injecting behaviors such as error propagation--but without the engine for Haskell's error handling misses the point of what functional languages are doing with errors.