Unnecessarily strong type constraints with polymorphic variants (when using...
That what you’re perceiving as a problem is exactly by design. Variants (polymorphic or not, I’m using the term loosely in this context) will always require exhaustive checks/pattern matching....
View ArticleUncurried mode - callback with two parameters
I’m trying to switch some code to uncurried mode and am having trouble using a callback that takes two parameters. I’ve searched the help and can’t find what I need. I’m trying to use the compare...
View ArticleUncurried mode - callback with one parameter
Feeling kind of stupid here. Trying the new uncurried mode. I don’t understand why the first one works below but the second generates a compile error. When I look at the intellisense on the callback...
View ArticleCan not pass a generic type to subtype function
How can I pass fooB to funA blog : Enhanced Ergonomics for Record Types | ReScript Blog playground : ReScript Playground type a = { name: string, age: int, } type b<'t> = { ...a, foo: 't, } type...
View ArticleUnnecessarily strong type constraints with polymorphic variants (when using...
I don’t think my first example is an error; I wrote it that way deliberately to make the typechecker infer the type of x in f to be ref<[> #b]>, and the type of x in g be [> #a]. That way,...
View ArticleAccessing array items by index, brackets return option?
I switched to V11 with Core and a bunch of my array access code is now broken. I didn’t see this on the list of breaking changes. My old code had a bunch of items[0] code that would return a specific...
View ArticleSuperfluous rec in a @react.component breaks transpilation?
I have checked that this bug has been fixed in v11.
View ArticleAccessing array items by index, brackets return option?
Rescript core causes it. Do you open it automatically? If it’s not in the scope the array access by using brackets will return the original data type
View ArticleUncurried mode - callback with two parameters
It probably means one of the two versions is curried and the other one is not, the error message got improved and should now be clear. What version of the compiler do you use?
View ArticleHow to convert record to object?
Do the queries return the same type? (as specified by the gql schema) If so, you can use fragments. A defined fragment (using gql ppx) can be used several times and the ppx will only generate a single...
View ArticleHow to convert record to object?
Thank you for the link! So using fragments was the answer to my XY problem
View ArticleRescript bindings for Graphql Codegen
I just started to use GraphQL on a project a few days ago—how is this different from using rescript-apollo-client with graphql-ppx?
View ArticleUncurried mode - callback with one parameter
Where does the module Seq come from? Is it GitHub - jmagaram/rescript-seq: Lazy sequences for ReScript? I’m not sure on the specifics here, but I believe, if you replace Js.log with Core.Console.log...
View ArticleHow to convert record to object?
otherwise you can also use the excellent rescript-relay that works perfectly with v11.
View ArticleCan not pass a generic type to subtype function
Since PR introducing this feature doesn’t state anything about type variables and I couldn’t find anything about it in the docs, I don’t think it’s supported. But I really don’t know. @cristianoc Are...
View ArticleCan not pass a generic type to subtype function
For now you can provide your own type conversion function: external bToA: b<'t> => a = "%identity" funA(fooB->bToA) ReScript Documentation ReScript Playground Try ReScript in the browser
View ArticleDebug mode with rescript 11.0
So about the issue, it at least is a known one: js_dump.ml build error when using `String(string)` variant in untagged union with other tag · Issue #6495 · rescript-lang/rescript-compiler · GitHub I...
View ArticleCan not pass a generic type to subtype function
No support for type variables in the current implementation. It could be supported in principle.
View Article