Applying good ideas to Rescript documentation
Hey @johnny.b.good, out of curiosity, how would you use this new LLM endpoint? In which workflow would you incorporate it?
View ArticleReact 19 and ReScript
We did not get around yet to use it at work, except with our NextJS website which is TS only. But that is mainly because we always use the version that’s also shipped with React Native/Expo since...
View ArticleReading a file contents
The team is currently working on better web bindings, and I think node would also be a good candidate in the future.
View ArticleUpdate the step argument for range sliders?
Hey there! I’m adding a range slider to my UI. According to MDN the step attribute should be a number or the string “any” to treat it like a contiguous range of numbers. However, with the current...
View ArticleUpdate the step argument for range sliders?
You could cheat and go with step={Obj.magic("any")}
View ArticleUpdate the step argument for range sliders?
Yes, with the generic JSX transform: JSX | ReScript Language Manual The same way how you would bind to Preact you can also “overwrite” the React bindings that are shipped with the compiler. Here is a...
View ArticleReact 19 and ReScript
FYI I’ve eventually taken the plunge and upgraded to React 19, everything worked perfectly out of the box straight away! I haven’t started using React Compiler yet though.
View ArticleApplying good ideas to Rescript documentation
Hi, to start with I will definitely create a private instance of GPT chat, upload the documentation to it and see how the chat will handle the process of educating, answering questions and solving...
View ArticleThis form is not allowed as the type of the inlined record could escape
I haven’t come across this error yet: This form is not allowed as the type of the inlined record could escape.. Here’s where I use the code: @jsx.component let make = (~data: data) => { switch...
View ArticleApplying good ideas to Rescript documentation
Thank you! Please feel free to share your findings and methods. I’m also interested in exploring ReScript and Ollama, which is why I asked. Related: AI Bindings for ReScript - Thanks for the Meetup
View ArticleThis form is not allowed as the type of the inlined record could escape
You defined an inline record inside of a variant, so you can’t create a variable of this inline type, you have to pattern match on its fields to to access them, like this: @jsx.component let make =...
View ArticleThis form is not allowed as the type of the inlined record could escape
Gotcha, that makes sense. This is probably an error message that could be made more clear
View ArticleThis form is not allowed as the type of the inlined record could escape
PR are always welcome, making error messages nice and clear is not an easy task!
View ArticleReading a file contents
Note: that returns a NodeJs.Buffer, you should use toString() to convert it to a string.
View ArticleReading a file contents
Hm, yeah, unfortunately Rescript doesn’t know that passing that encoding makes the function return a string.
View ArticleReading a file contents
Then it should probably be a separate binding? @module("node:fs") external readFileSyncUtf8: (string, @as(json`{"encoding": "utf8"}`) _) => string = "readFileSync" ReScript Documentation ReScript...
View ArticleHow can I implement Order from Effect-ts
Need help translating this typescript code: export type Order<T> = (a: T, b: T) => -1 | 0 | 1; export const make = <T>(compare: Order<T>) => (self: T, other: T) => self ===...
View ArticleHow can I implement Order from Effect-ts
This looks pretty straightforward to bind to. What did you try and what errors did you get? Send a playground link.
View ArticleHow can I implement Order from Effect-ts
I did not want to write bindings, I want to write this (or something similar) in rescript. So far I’ve got this: type t<'a> = ('a, 'a) => Core__Ordering.t let make = (compare: t<'a>,...
View ArticleHow can I implement Order from Effect-ts
I would just do this: let map = (order, getter) => (self, other) => order(getter(self), getter(other)) Playground link I’d be cautious about using == for make, why not using the properties of...
View Article