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

Image may be NSFW.
Clik here to view.

Firebase modular bindings

Ok, thanks for open sourcing it

View Article


Using open but for just one type?

One of my favorite things about rescript is it’s ability to infer a type from usage. But that only works when the type is in the same module, I was wondering if there’s some kind of way to “open” that...

View Article


Image may be NSFW.
Clik here to view.

Using open but for just one type?

Unfortunately, you can only do that with values, not types: let {make} = module(User) (works) type {t} = module(User) (does not work) but I found out you can kinda do it with record spreads if the...

View Article

Firebase modular bindings

Sure thing, fixed rescript-firebase/src/Firebase.res at main · nojaf/rescript-firebase · GitHub If anyone in the future is playing with Rescript & Firebase, feel free to reach out here.

View Article

Using open but for just one type?

Beware that this will create a new type that’s considered another type than User.t. You can of course use coercion with that type (someTValue :> User.t) but still, not quite the same as using the...

View Article


Using open but for just one type?

Right, it’s not really the equivalent of open but of include. Another way to do it is to have type t in a submodule and only open that one. module User = { module Type = { type t = { ... } } ... }...

View Article

Using open but for just one type?

Yeah having it in a submodule is probably the least invasive way of doing it.

View Article

Using open but for just one type?

Namespacing your types inside a module is a good habit anyway!

View Article


Using open but for just one type?

Isnt there a substitution type assignment? type t := User.t Generally strikes me as a bad idea but maybe?

View Article


Current goal of genType with regard to type safety

Hello. A long time since I’ve posted here, so it’s possible I’ve missed something, although I have done a search to check. I have also been stuck on rescript@9 for several years, so I’ve totally...

View Article

Image may be NSFW.
Clik here to view.

Current goal of genType with regard to type safety

I should add – this is what I currently see: And this is what I expected/hoped to see:

View Article

Func Prog Sweden

Hi everyone, A while back, I had the chance to give a virtual talk at Functional Programming Sweden. The experience was great, and I think it would be awesome if someone from the ReScript community...

View Article

Func Prog Sweden

You know, we have a Swede here who might even be able to join physically, right @zth? But other than that, we should rather speak at meetups where functional programming is NOT the central topic. Like...

View Article


Func Prog Sweden

Interesting feedback. Those in the functional programming community who are doing frontend work may have already decided on their preferred tools. It’s probably more important to inform the mainstream...

View Article

Image may be NSFW.
Clik here to view.

Recursive types in nested modules

Hello, I would need to create bindings for recursive types, but I want the types to be in a separate module: module Foo = { module A = { type t = {b: B.t} // Gives error } module B = { type t = {a:...

View Article


Image may be NSFW.
Clik here to view.

Recursive types in nested modules

Modules can be recursive as well, but then you need to give them explicit module type definitions: module Foo = { module rec A: { type t = {b: B.t} } = { type t = {b: B.t} } and B: { type t = {a: A.t}...

View Article

Image may be NSFW.
Clik here to view.

Recursive types in nested modules

Thanks, I gave up and went for @get instead: module Foo = { type a type b module A = { @get external b: a => b = "b" } module B = { @get external a: b => b = "a" } } let a: Foo.a = %raw(`{}`)...

View Article


JS API to compile ReScript to JS

Don’t think I tried it with runes. I would assume it works. The preprocessing stage just turns the svelte component into something the svelte compiler would understand, I think there is support for...

View Article

Dynamic property name

Hello, I need to create an object with a single property with a dynamic name. let key = "meh" // imagine any expression that returns a string here let a = { key: 4 } // doesn't work How can I achieve...

View Article

Dynamic property name

You could use Dict if you just need the JS object. Example.

View Article
Browsing all 1739 articles
Browse latest View live