Quantcast
Channel: ReScript Forum - Latest posts
Browsing all 1739 articles
Browse latest View live

Rescript frustration

Do you have an example of what that would look like from another language?

View Article


Rescript frustration

I believe that’s the question mark operator from rust (along with other similar monadic sugar). Assuming I’m correct, (forgive me if I’m not!), the closest current rescript would be to use pipes with...

View Article


Image may be NSFW.
Clik here to view.

Rescript frustration

yes , the question mark operator from Rust comes to mind first, and I think I prefer it. Other languages do it in other ways as well. Gleam has use expressions Introducing use expressions! - Gleam I...

View Article

Recursive references in library binding function body?

I’m working with Preact’s signals in ReScript and I’m implementing a lightweight Finite State Machine using variants. I’m trying to implement a transitionSignal so that components can subscribe to...

View Article

How to use probs with preact

May depend on your bindings but I do have an example at color-scheme-tool/src/App.res at 08c39c18aae4616e411a58375054ca05b4e714d5 · jaidetree/color-scheme-tool · GitHub The key is: onInput={e => {...

View Article


Rescript frustration

I didn’t know about the ? operator in rust, it looks interesting but how do you do when you use it multiple times in the same function with expressions that return different error types? I’m not a big...

View Article

Image may be NSFW.
Clik here to view.

Rescript frustration

tsnobip: I didn’t know about the ? operator in rust, it looks interesting but how do you do when you use it multiple times in the same function with expressions that return different error types? you...

View Article

Rescript frustration

The fact ? needs to return the same type of error significantly reduces its appeal imo. Regarding option helper functions, there’s quite many of them now in Core, I think you’re looking for getOr or...

View Article


Image may be NSFW.
Clik here to view.

Rescript frustration

tsnobip: The fact ? needs to return the same type of error significantly reduces its appeal imo. this is a fact of life in rescript. you gotta be misinterpreting me, or i’m misinterpreting you. it’s...

View Article


Rescript frustration

Things described here I’d like to import to ReScript someday. I’d like to say that I’m already exploring options, including the things mentioned here, especially direct-style control flow. I’m taking...

View Article

Rescript frustration

Brain dump here, this is my personal roadmap (v13? i’m not sure) Early-return semantics, let-else guard Iterators & better for loop, I’m now reviewing prior arts (my current pick is Zig)...

View Article

Rescript frustration

Especially the iterator and control flow enhancement were among the topics we actively discussed and agreed upon for improvement at last year’s retreat. I consider myself a champion for it, but I’ve...

View Article

Recursive references in library binding function body?

I’m not very familiar with Preact Signals, but I’m quite surprised that it allows this kind of recursive referencing. Is this a common case? Can you give me an expanded example in JavaScript?

View Article


Rescript frustration

thanks for your posts - rescript will be an absolutely amazing language with some more time to mature.

View Article

Image may be NSFW.
Clik here to view.

Rescript frustration

xfcw: each branch has to generate the same type output. You’re right, but if a switch case doesn’t return the same type, you can then change its type in the branch as you did in your code actually,...

View Article


Rescript frustration

I’d say using guards to reduce the visual complexity of deeply nested pattern matching is quite common and great experience in Rust and Effect-TS early returns are ok with sane type system support.

View Article

Rescript frustration

are you recomending exceptions for program flow? i mean i get the idea here, but it might not always be exceptional situations. i guess i can just throw raise in everywhere to simulate early returns…

View Article


Rescript frustration

As I said it’s not a silver bullet, but for cases where the errors should stop the program flow and bubble up to the user anyway, like it’s the case for a CLI, I don’t really see the point of carrying...

View Article

Image may be NSFW.
Clik here to view.

Rescript frustration

xfcw: there is no “map” function for None states, meaning you cant do something like value->Option.getOrElse(slowSyncOp). the value provided to getOr has to be computed before putting it into...

View Article

Rescript frustration

I think it’d be a nice addition to Core APIs.

View Article
Browsing all 1739 articles
Browse latest View live