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

Shouldn't we be allowed to assign anything to `unknown`?

I have have a BSON parser that can fail when an attempt is made to parse a leaf into an expected structure. let’s say the BSON parse expects an int at a leaf, but it sees something else (e.g., a...

View Article


Shouldn't we be allowed to assign anything to `unknown`?

why don’t you use the type of the unparsed BSON for the payload of this exception?

View Article


[ANN] ReScript 12 beta release / call for testing

Yeah this is a major pain. The reason for this being the way it is is that the compiler is not designed to continue when it encounters a type error. This is because it wouldn’t be able to type check...

View Article

Shouldn't we be allowed to assign anything to `unknown`?

this is absolutely a fair point that i should consider, although i also have this: let anyOrThrow = obj => switch any(obj) { | Some(o) => o | None => throw(InvalidValue(Obj.magic(obj))) } as...

View Article

[ANN] ReScript 12 beta release / call for testing

although i agree it would be a nice qol improvement, i never found it to be a major pain. only seeing the next error is fine, because you fix it, and then you immediately see the next anyway. go to...

View Article


Shouldn't we be allowed to assign anything to `unknown`?

well this definitely calls for an Obj.magic anyway ^^

View Article

[Feedback] Preserve JSX mode

In the latest betas, you can now enable preserve mode via { "suffix": ".res.jsx", "jsx": { "version": 4, "preserve": true }, } However, this won’t get picked up if you use rescript legacy build. This...

View Article

RFC: Variant maps

I had an idea for a new language feature. Before I sat down and tried to hack it out myself, I wanted feedback and thoughts. Suggestion Allow a special type of object/record, which I will henceforth...

View Article


RFC: Variant maps

this looks like a good use case for meta programming, I’m pretty sure you could generate the variant from the record type using @rescript/tools for example!

View Article


[ANN] ReScript 12 beta release / call for testing

I’m still getting this. I’ve tried cleaning and I’ve been removing dependencies hoping that would resolve the issue. I’ve even tried adding the Pervasives.res file to my project directly and I still...

View Article

Image may be NSFW.
Clik here to view.

RFC: Variant maps

I could certainly try that – It looks like rescript tools is vs-code thing primarily? I use Emacs mostly. You definitely could do something with a ppx-type thing. However, doesn’t it seem like it...

View Article

[ANN] ReScript 12 beta release / call for testing

interesting re. pnpm vs npm. maybe you can git add node_modules and do a diff with pnpm / npm?

View Article

[ANN] ReScript 12 beta release / call for testing

i’ve deployed beta 4 since it was released and have it running in production non-stop, working fine (had to do migrations for the *ToEnd functions). what’s missing for a final release?

View Article


[ANN] ReScript 12 beta release / call for testing

This is the v12 milestone, there are still some bugs: GitHub · Where software is built Also lot’s of documentation to be done. That’s not to say every single issue there has to be resolved, but the...

View Article

[ANN] ReScript 12 beta release / call for testing

We’re still fixing some remaining bugs and I think we’d also like to deploy a migration tool before releasing v12.

View Article


RFC: Variant maps

(Rescript tool is now part of v12, so installing v12 beta gives you access to npx rescript-tools) You could get (limited) typed tree information as JSON via # requires a build first npx rescript-tools...

View Article

Proposing new syntax for zero-cost unwrapping options/results

something I would like is a way to write exception-free code in rescript, like rust. this becomes even more relevant with this proposal, as we can do early returns on errors to propagate errors up...

View Article


Welcome Sury - successor of ReScript Schema

tbh, this should be included in the rescript stdlib as a sort of spec to guarantee object shapes on the ffi boundary with automatic checks.

View Article

Welcome Sury - successor of ReScript Schema

I’d say Sury is a little bit too opinionated to be a part of the Stdlib. It’s more like a framework, which you install anyway if you need it. Also, there’s a really nice way to pattern-match on JSON...

View Article

Proposing new syntax for zero-cost unwrapping options/results

That’s definitely an interesting idea. Maybe by an annotation or similar: @toResult external somethingThatCouldThrow: string => string = "somethingThatCouldThrow" // let somethingThatCouldThrow:...

View Article
Browsing all 2592 articles
Browse latest View live