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

Gleam neither has the ternary operator nor the if-else construct. It instead uses the equivalent construct for switch called case. It uses case as the do-it-all for control flow. It also has use keyword for making it easy to work with callbacks. The combination of use and result.try has interesting parallels compared to what’s being done here with await or anything that yields a Result and its unwrapping .

In the end, this feature will deliver improvements which will make writing ReScript a better experience if not ideal. So I’m happy with this step forward. Looking forward to a swift v12.1 release.

Also, thank you for genuinely considering my wacky ideas!


Viewing all articles
Browse latest Browse all 2592

Trending Articles