Easily ignore labeled arguments?

With normal arguments you can do this:

let foo = (_bar) => false

to get rid of warning 27: unused variable

Is there a way to do something as easy with labeled arguments.
I’m aware you can say

let foo = (~bar) => {

But imho that’s not “good enough” because often it means I need to add curly brackets to a function that had none before.

I’ve actually considered changing some of the functions to use a single record as an argument instead of a set of labeled arguments to make this easier to manage. What do people think about that approach?


What’s the use case?
you usually want to consume the argument.

I think you can use as to rename the argument:

let foo = (~bar as _) =>  false

Nice. I didn’t know you can do that. That’s good enough for now :slight_smile:

Edit: The use case is reusable components that offer a callback function prop that has multiple arguments. Sometimes you use them, sometimes you don’t.