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

That’s definitely an interesting idea. Maybe by an annotation or similar:

@toResult
external somethingThatCouldThrow: string => string = "somethingThatCouldThrow"

// let somethingThatCouldThrow: string => result<string, JsExn.t>

@xfcw if you’re interested in this, would you open an issue on the compiler issue tracker so we have somewhere to discuss? It’s off topic for this thread of course.


Viewing all articles
Browse latest Browse all 2592

Trending Articles