2 ms·
The Either type described in the first comment is also a Monad. They are more important in Haskell than just "when you need to write to a file..." and I don't t
by morphyn 14y ago
The Either type described in the first comment is also a Monad. They are more important in Haskell than just "when you need to write to a file..." and I don't think you can totally grasp the error handling method without understanding them.
- flyinRyan 14y agoI couldn't disagree more. The Either type may have a Monad interface, but it's a Sum type and languages that don't have thousands of Monad tutorials also have Sum types. There's no need to explain Monad theory to someone just to explain Sum types or even why chaining do expressions doesn't do unnecessary computations in the face of errors. Just show them the code for join and >> and they'll see why it works. No need to bring up Monads.
- Evbn 14y agoI don't know what a thread is, but I can still use Executors in Java.