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

Not 100% sure I follow, but if you don’t want to bubble it you could just not use let? for that particular thing. You can still do whatever you want in between let?, just that the return type of the block will need to be whatever let? says, below it.

So, if you wanted to panic on an error it’d be as simple as using a Result.getOrThrow. Or a switch + panic(). Or any of the other existing Result helpers that might be fitting.


Viewing all articles
Browse latest Browse all 2592

Trending Articles