News for hackers. Stuff that matters.
Re:Elegant Error Handling with the JavaScript “Either” Monad by taeric on Wednesday June 19, 2019 @12:23PM (#20224694)
I think the point is there is no inherent meaning. It is just two possible results. Could be an error, could just be another likely path. Will only be one of them, though.
Re:Elegant Error Handling with the JavaScript “Either” Monad by marcosdumay on Wednesday June 19, 2019 @12:34PM (#20224793)
But there is a difference in meaning. Left shortcuts, Right doesn't.

It would be bad to name it after error handling, but the entirely meaningless names aren't great either.

Re:Elegant Error Handling with the JavaScript “Either” Monad by jayshua on Wednesday June 19, 2019 @03:27PM (#20226515)
Left only shortcuts because of the implementation of the map function. There could just as easily be mapLeft and mapRight functions instead, allowing you to choose the shortcut behaviour.
Re:Elegant Error Handling with the JavaScript “Either” Monad by hombre_fatal on Wednesday June 19, 2019 @12:53PM (#20224952)
I don't think there's any documentation on Haskell's Either monad that doesn't explain that Right=Good even if it's only by convention. But its functions also has right affinity, so Right and Left cannot have equal weights. You have to decide why this result is in the right/default slot over the other one.
Re:Elegant Error Handling with the JavaScript “Either” Monad by toastal on Wednesday June 19, 2019 @01:12PM (#20225131)
But Either is also a Bifunctor so you CAN do to the Left what you do the the Right as well as unpacking the value from both sides.
Re:Elegant Error Handling with the JavaScript “Either” Monad by jupp0r on Wednesday June 19, 2019 @12:28PM (#20224740)
I agree that Either is more general than error handling, but it's widely used for that in practice. The original article uses it for that, too.