3 ms·
Are there any other languages that do error handling like Go? Key features: potential of error value is visible in type signature, errors can have rich informat
by supersillyus 15y ago
Are there any other languages that do error handling like Go?
Key features: potential of error value is visible in type signature, errors can have rich information but share a common type, and are returned out of band. I guess Either in Haskell is similar, but has syntactical support for chaining (in the Error monad). You could probably use an instance of an Error typeclass for the failure value, but I think you'd need to use Data.Dynamic somehow to be able to check what sort of error it is and unpack it and I'm not sure if you can easily compare it to a statically known error (my Haskell is a bit rusty.)