Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Go
- func doStuff(context Context) (err error) {
- x, err := computeX()
- if err != nil {
- context.Errorf("Error computing x: %v", err)
- return
- }
- err = doSomethingWithX(x)
- if err != nil {
- context.Errorf("Error doing something: %v", err)
- }
- return
- }
- -- Haskell
- doStuff :: (Monad m) => ExceptT Error m a
- doStuff = do
- x <- computeX
- doSomethingWithX x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement