Hacker News new | ask | show | jobs
by masklinn 3233 days ago
> But I prefer to decorate each error as it comes back from the callee

That's trivially feasible and still shorter than the Go version:

    a <- decorate (squareRoot x)
    b <- decorate (log a)
    c <- decorate (log b)
Outside of the do context, your return value is just that, a value, you can manipulate it using the language's regular tooling. And you can decorate the do context itself if you want the same decoration for all calls in the block.