Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It looks the same to me.

The key point is that because Maybe is a monad, you can chain things together and handle failure at the end much like a try/catch:

    let result = do
        x <- f(t)
        y <- g(x)
        z <- h(y)
        z
      in
    case result of ...
You are correct that this isn't particularly novel.


And as Go lacks both exceptions and Maybe/Option type, chaining or computation expressions will look more clumsy. I am still a Go beginner and am wondering if idiomatic Go designs programs in a different way to make up for this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: