3 ms·
So basically, monadic error handling, that is, using `Optional<T>` and `Error<T>` and just `map`ping everything (which is a nop on the nil and error variants)
by bruce343434 3y ago
So basically, monadic error handling, that is, using `Optional<T>` and `Error<T>` and just `map`ping everything (which is a nop on the nil and error variants)
- jgilias 3y agoWhich is how things actually work in non-FP languages too. In those you’re _always_ within Exception<T> and MaybeNull<T> monads. It’s just implicit and we tend to just cross our fingers and hope it’s all well.
- mrkeen 3y agoTo drive the point home a little a little harder: I don't use Haskell because it has a representation for values which might exist (all languages have that), I use it because it has a representation for values which do exist.
- tome 3y agoA little harder still: It does not have a representation for values which do not exist! (see also: "make invalid states unrepresentable")