News for hackers. Stuff that matters.
Re:Visual Studio Code for Go by KirinDave on Thursday March 03, 2016 @01:32PM (#11218816)
Well it's not like the Either monad (Haskell) or erlang's {err, Reason} pattern is much better. Go's just bad at sharing details about new errors, in that interfaces are a pretty poor tool for that sort of work. At least Either has an Applicative and Monadic form, which is really nice for decoupling flow from handling.

Error handling is tricky because it requires richness both in how you talk about types and how you handle control flow.

But using GADTs and to a lesser extend F#'s discriminated unions for errors does have nice static checking properties. That's definitely an improvement over Go's "I just regex'd the string please send help" approach.

There are no comments on this comment yet.