2 ms·
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:
by yummyfajitas 14y ago
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.
- irahul 14y agoAnd 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.