Is there a way to automatically create objects in args?

I’m creating a binding for an external JS function with type (TS):

reorder: ({ from, to }: { from: number; to: number }) => void;

Is there a way inline the creation of this object from named arguments? Perhaps something like:

external reorder: (@obj (~from: int, ~to: int)) => unit = "reorder"

IIUC, you’re on the right track, see Syntax Lookup


external reorder: (~from: int, ~to: int, unit) => 'reorder = ””

let r = reorder(~from=0, ~to=10, ())


My bad, just saw the void. Not sure if you can do it in one step.