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

Building with RescriptRelay, a video series

I’m happy to introduce “Building with RescriptRelay”, an ongoing video series where we build a RescriptRelay web app using data from the GitHub GraphQL API. RescriptRelay is a framework for using...

View Article


Is there a way to get the name of variant in type

I don’t think you can generate this automatically, but I’d say it’s not much of a big deal to write it yourself. There’s a technique that allows you to make sure you didn’t forget a case in your...

View Article


Is there a way to get the name of variant in type

@tsnobip Hi, thanks for your quick response. why we need to define module here? If I remove module module Foo: { type t = Bar | Baz let elements: array<t> } = { the warn was gone. And if some...

View Article

Is there a way to get the name of variant in type

The module type is here to make the dup type internal only, given it can’t be used outside of the module, the compiler can track if all of its variants are used or not. Can I ask you why you need to...

View Article

Is there a way to get the name of variant in type

Thanks for your quick response. I am learning redux toolkit, and try to make it work on ReScript + Preact. The reducers need some unique string for the action name (example code, so I think the type...

View Article


Building with RescriptRelay, a video series

Episode 3 is out. We do the following: Create a new route with codesplitting and data preloading (render-as-you-fetch) Reuse the components we’ve already built, using fragments Create type safe links...

View Article

Is there a way to get the name of variant in type

to be honest, given rescript has native support for a tool as powerful as variants/algebraic data types and exhaustive pattern matching, basic useState and useReducer can take you very far away, I’d...

View Article

Is there a way to get the name of variant in type

Thanks for your advice, while application comes too big, redux (toolkit) is a good tool. I find your example can write more simple (without define twice type myType) playground

View Article


Building with RescriptRelay, a video series

Another video out. We cover: The Node interface How Relay uses suspense How use suspense and Relay partial rendering to control route loading experience How to use the Relay+React dev tools to work...

View Article


Building with RescriptRelay, a video series

So cool that you start covering the advanced parts too! Great job!

View Article

Image may be NSFW.
Clik here to view.

Is it good idea having binding to JS this?

Added support for Js.globalThis github.com/rescript-lang/rescript-compiler Add `Js.globalThis` object binding rescript-lang:master ← cometkim:js-global-this opened 05:57PM - 24 Jul 24 UTC cometkim +7...

View Article

Variant with generic "mysterious" behaviour

Hello, dear community, I’ve stumbled upon an interesting behaviour of the variant type. Here’s an example: module Post = { type t = {userId: int} let decode = (_t: Js.Json.t): result<t, string>...

View Article

Variant with generic "mysterious" behaviour

hmm indeed the error is not obvious at first sight. Polymorphic type annotations don’t work the way you think they do in Hindley-Milner type systems, you can for example do this: let foo : 'a = 1 It’s...

View Article


Building with RescriptRelay, a video series

Next one is out. We go through all you need to know about doing pagination, and what connections really are. 5: Connections and Pagination in Relay

View Article

Image may be NSFW.
Clik here to view.

Announcing the Fields form library

Hi All I am proud to announce the public release of the form system I developed for in house use here at Noble Ai, called simply Fields. GitHub GitHub - noble-ai/rescript-fields: Elaborate form...

View Article


Variant with generic "mysterious" behaviour

@tsnobip you’ve connected the dots with these two: let foo : 'a = 1 and… all branches of a switch need to return the same type. Thank you for pointing this out! Can I say that I “trigger” the...

View Article

Variant with generic "mysterious" behaviour

@tsnobip GATD worked amazing and I think the solution looks pretty elegant, actually. Could you recommend a place to learn more about GATDs in Rescript (or OCaml)?

View Article


Image may be NSFW.
Clik here to view.

Variant with generic "mysterious" behaviour

Yes, I think you have a pretty good understanding of the issue now!

View Article

Variant with generic "mysterious" behaviour

Unfortunately there’s no good resource about GADTs in rescript that I know of, but there are quite a few of them in ocaml, the syntax is different but the language is extremely close, you can take a...

View Article

Image may be NSFW.
Clik here to view.

Variant with generic "mysterious" behaviour

There is also Sketch.sh - Interactive ReasonML/OCaml sketchbook which is in Reason syntax so very close to ReScript. sketch.sh Sketch.sh - Interactive ReasonML/OCaml sketchbook Sketching...

View Article
Browsing all 2602 articles
Browse latest View live