Unnecessarily strong type constraints with polymorphic variants (when using...
I don’t feel like an expert on this topic, but I think I’m able to explain the issue: I adapted your example in the playground to not use React.useState but a custom function having the same...
View ArticleRescript bindings for Graphql Codegen
This repo is for making use of graphql-codegen to generate files. The main benefits are: Rescript 11 support - this is written in v11, so no worries about uncurried mode. Transparency - you make...
View ArticleUncurried mode - callback with one parameter
Yes using Console.log works. I just don’t understand why Js.log works in one case but not the other.
View ArticleAccessing array items by index, brackets return option?
The comment with the return value is out of date. Working on a PR to get that fixed and make it clear that accessing an item in an array returns an option.
View ArticleUncurried mode - callback with two parameters
Version 11.0.1. I’m not sure what happened but I’m now able to just pass the function in without creating a new lambda. Hmmm… So the problem seems to have gone away.
View ArticleAccessing array items by index, brackets return option?
As others said, having Core open causes this behavior. But if you really want unsafe access, you can write an Array module that has its own get function that returns 'a instead of option<'a>. //...
View ArticleUnnecessarily strong type constraints with polymorphic variants (when using...
Thank you for the thorough reply, I really appreciate it! However I am still puzzled by: " * there isn’t any possibility of x being something else than #a" If I slightly modify g: let g = () => {...
View ArticleHow to convert record to object?
Relay does seem really promising—especially the baked-in pagination support! So to use Relay, I should replace Apollo with this, right?
View ArticleHow to convert record to object?
Yes that’s right! Ideally your graphql server should be compatible with relay too.
View ArticleHow to convert record to object?
I’m using Hasura and the doc says it supports Relay, so I guess I’m ready!
View ArticleHow to hook up to using @mui/material bindings?
I am trying to hook up a binding to @mui/material/Box but can’t seem to figure it out. I have the following 2 files set up currently. Box.res @module("@mui/material/Box") @react.component external...
View Article[ANN] ReScript Core 1.1.0 is out
Hey @zth , Not able to use “Dict.forEachWithKey” with rescript- v11.1.0-rc.6 version in Rescript Playground. Can you help if I’m using it incorrectly ? Issue Thanks in advance
View Article[ANN] ReScript Core 1.1.0 is out
Sorry, we forgot to update the playground to Core 1.1.0. This needs to be done manually until core is merged into the compiler. Here is a tracking PR: Upgrade playground dependencies by fhammerschmidt...
View Article[ANN] ReScript Core 1.1.0 is out
It’s merged already, but it will be deployed with the next compiler release candidate.
View ArticleHow to hook up to using @mui/material bindings?
Turns out I didn’t have jsx enabled in my rescript.json "jsx": { "version": 4 },
View ArticleCustom data-attributes in JSX
Hi, Disclaimer: I am new to Rescript world! At my workplace we are creating a design-system that manipulates the behavior of a component using custom data-attributes that we add to JSX elements. In...
View ArticleModular integer division operator?
Is there a modular integer division operator? I tried 5 % 3 and it doesn’t work. I can’t find the function in Math.Int.
View ArticleCustom data-attributes in JSX
The upcoming ReScript version 11.1.0 is for you! It will ship both with a generic JSX transform which includes among other things the possibility to extend the attributes of lowercase JSX tags and...
View ArticleModular integer division operator?
Since you are using the exact same numbers from the overview in the docs, I suppose you don’t want to use mod(5, 3) but are looking for a infix operator, which does not exist (yet)?
View Article