Making `@variadic` work with a dynamically generated array arg
In the following code snippet, how do I make the latter two work like the first? @module("path") @variadic external join: array<string> => string = "join" // 1. works as expected let v1 =...
View ArticleMaking `@variadic` work with a dynamically generated array arg
@variadic works with dynamic array arg, that’s actually why Caml_splice_call.spliceApply is used. If you select v12 you’ll notice it now compiles to a cleaner: Path.join(...args2) Playground link
View ArticleHow to return record of specific type?
I have a react element that has: type opt = {label:string, value:string} type props = { label?: string, value?: string, data: array<opt>} because rescript figures out the type from the record...
View ArticleHow to return record of specific type?
It’s good practice to put such record types into their own modules, then you can qualify the module where the record comes from after the opening curly brace: e.g.: module Opt = { type t = {label:...
View ArticleHow to return record of specific type?
that makes sense, thanks. Im not used to modules yet
View ArticleExecuting Code In The Playground
@fweth you had to be patient but we finally landed fully functional code execution in the playground! You can get the output from the console and also render React components. Just remember to enable...
View ArticleBasic misunderstanding? (Playground issue?)
@chasm we’ve finally fixed this bug, all runtime dependencies now get correctly imported and your example now works: ReScript Documentation ReScript Playground Try ReScript in the browser
View ArticlePlayground - Core library error
@kay-tee we’ve finally fixed this bug, all runtime dependencies now get correctly imported and your example now works: ReScript Documentation ReScript Playground Try ReScript in the browser
View ArticleRun code in the playground
Hello everybody, We’re very happy to announce you can now run code (including when there are runtime dependencies from the standard libraries) in the playground! Just remember to enable “Auto-run”....
View ArticleRun code in the playground
might need to add a cap on the log lines first thing I did was set fizzbuzz to a really big number and it crashed my browser
View ArticleRun code in the playground
Well there are tons of ways you can crash your browser by executing arbitrary code, with or without logging, I’m not sure we should spend too much time trying to mitigate those issues, but if you’re...
View ArticleRun code in the playground
sure thing. I think I was just making a note that auto-run felt a bit unintuitive XD
View ArticleRun code in the playground
not really used to having my code run as I type and I ended up crashing the browser window. Used the word unintuitive because it’s a cool feature, just unexpected results
View ArticleRun code in the playground
Oh I see, we could add a “Run” button as a way to run your code on demand without doing it on every key stroke. What do you think?
View ArticleRun single .res file
Hello everyone, I have a quick question: Can ReScript run individual .res files? I’m currently prototyping a CLI application and exploring alternatives to TypeScript. I’m still getting familiar with...
View ArticleLeverage ES decorators
Rescript has builtin decorators (attributes), would it be possible to define them in user space?
View ArticleRFC: Nested record definitions
Would it be possible to have indexed access types to alias nested types directly? They are well proved on typescript nested record access type options = { startFrom: float, persist?: { fileName:...
View ArticleRFC: Nested record definitions
This feature and local type are super useful in Typescript.
View Article