Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Proposing new syntax for zero-cost unwrapping options/results

$
0
0

To be fair, if reconnectAndGetConn returns a compatible error type, this would presumably allow us to try to recover, right?

let? Ok(r) = switch getConn() {
| Ok(x) => Ok(x)
| Error(ErrorA) =>
  reconnectAndGetConn() // hypothetical recover
| Error(ErrorB) =>
  Error(ErrorB) // not possible?
}

Viewing all articles
Browse latest Browse all 2592

Trending Articles