Hacker News new | past | comments | ask | show | jobs | submit login

You'd have the same effect (you don't know what specific call failed) if all of the comment lines said "return err", which is a common pattern in Go. The Scala approach mentioned is just sugar for that. You can of course handle each case separately if you want in Scala, just as you can in Go, but the common pattern has sugar.



What? Actually, absolutely not.

If you only care about whether something succeeded use Option, if you care about the error use Either, Validation, etc.

Just pick the right Monad.


Yes, I agree, but I don't see how that's related to what I said.


Then maybe don't comment?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: