Skip to content

Partial application is not quite right for uncurried functions with labeled args. #6164

Closed
@cristianoc

Description

@cristianoc
@@uncurried

let add = (~x,~y,~z) => x+y+z

let ptl1 = @res.partial add(~y=3)

let v1 = ptl1(~x=1, ~z=3)
Js.log2("v1:", v1)

gives

function add(x, y, z) {
  return (x + y | 0) + z | 0;
}

function ptl1(param) {
  return function (param$1) {
    return add(param, 3, param$1);
  };
}

// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';


function add(x, y, z) {
  return (x + y | 0) + z | 0;
}

function ptl1(param) {
  return function (param$1) {
    return add(param, 3, param$1);
  };
}

var v1 = ptl1(1, 3);

console.log("v1:", v1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions