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

Broken example code in Belt api

Oh yeah that’s a bit hard to grasp right now, this will be solved in ReScript v12, but for now you have this issue with the libraries shipped with the compiler (like Belt), it doesn’t automatically...

View Article


Broken example code in Belt api

Okay, thanks!. That fixed my issue and makes sense.

View Article


Get typed AST from Rescript file

Which part, for dumping out info? Btw, did you manage to do anything with the docs json?

View Article

Get typed AST from Rescript file

Btw: how does the decoder output look like (RescriptTools.Docgen.decodeFromJson)?

View Article

Generating getter for method in record

Is there a option to generate getter for method in a record? E. g., for this ReScript code: type state = Init type api = {state: unit => state} let instance: api = { let state = ref(Init) {state:...

View Article


Get typed AST from Rescript file

There’s no decoder, it’s just an identity function. The full structure can be modelled using v11 variants (which is an achievement in itself!).

View Article

Error compiling @rescript/core with Rescript 11

Yes, is my own library, I’m installing locally it with npm link

View Article

Cannot able create a Record from another Record (With all optional keys)

type a = { t ?: string, l ?: int, p ?: array<int> } type b = { t ?: string, l ?: string, p ?: string } let intToString : option<int> => option<string> = (s) => { switch s{ |...

View Article


How to construct a regular expression of a JS?

It doesn’t work new...

View Article


Generating getter for method in record

Technically, yes let instance = { let state = ref(Init) Object.createWithNullAndProperties({ "state": { "get": () => state.contents } }) } Though I think just using a getState function makes it...

View Article

Generating getter for method in record

Thanks. Just for a context, this may be useful in a situation with an API that you cannot change.

View Article

Get typed AST from Rescript file

Oh okay. Didn’t look into the code. Just saw the last code block in the README.

View Article

Get typed AST from Rescript file

Let’s see if I can find some time to get an initial experimental version out where we can dump typed info to JSON, and we can build on it from there. Easy access to a structured way of working with...

View Article


Get typed AST from Rescript file

Yes, for getting AST information. I was able to solve my use case with the JSON documentation dump. I needed the exported function names and their input and return type, which I was able to find in...

View Article

Get typed AST from Rescript file

Couldn’t we generate a json schema of rescript AST? Then one could use pretty much any tool to work on it, including rescript using rescript-json-schema for example.

View Article


Cannot able create a Record from another Record (With all optional keys)

As you can see in the playground, the generated JS code for the mapper function is the following: function mapper(a) { return { t: a.t, l: intToString(a.l), p: arrayToString(a.p) }; } What JS code...

View Article

Cannot able create a Record from another Record (With all optional keys)

I was thinking of writing this code in Js to get my use case. function mapper(a) { const result = {}; if (typeof a.t !== "undefined") result.t = a.t; if (typeof a.l !== "undefined") result.l =...

View Article


Cannot able create a Record from another Record (With all optional keys)

The issue is mostly performance. Where I have to write a function to loop over object and remove keys that have undefined value.

View Article

Image may be NSFW.
Clik here to view.

Created an Automatic Doc Extraction and Generator for React components

Hi there, I have been working on this library for rescript react components, wanted to have a proper and low-maintenance documentation for these components. So I have created a doc-generator tool,...

View Article

Created an Automatic Doc Extraction and Generator for React components

Very cool! Would be nice with some published example docs somewhere to see it in action.

View Article
Browsing all 1759 articles
Browse latest View live