Skip to content

Make pipe-first work with uncurried functions #4342

Closed
@yawaramin

Description

@yawaramin

Currently, this:

let f = (. x, y) => x + y;
let x = 1->f(. 2);

Does not work, with the error:

We've found a bug for you!
OCaml preview 2:15

This is an uncurried BuckleScript function. It must be applied with a dot.

Like this: foo(. a, b)
Not like this: foo(a, b)

This guarantees that your function is fully applied. More info here:
https://bucklescript.github.io/docs/en/function.html#solution-guaranteed-uncurrying

As we are placing more emphasis on uncurried syntax in BuckleScript, I think it makes sense to have the pipe-first operator work with uncurried functions as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions