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

I’m all for this proposal

At the moment switch case verbosity is so bad my Rust implementation has the same amount of lines as Rescript.

let? Makes a lot of sense, the ? Shows the None is quick returned, and the Some shows what you are looking for.

And competes with Gleam’s use var <- try(fn())

Dart and Rust also have eager error handling with ?

GoLang’s 3lines of if err != nil after every functionality makes me nauseous

Playing devils advocate: would this work? let? Error(err) = fn() as an early happy return.


Viewing all articles
Browse latest Browse all 2592

Trending Articles