Open
Description
See playground:
@module("my-int-lib") external add: (int, int) => int = "add"
type intOp = (int, int) => int
@module("my-int-lib") external sub: intOp = "sub"
let add1 = a => a->add(1)
let sub1 = a => a->sub(1)
compiles to:
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as Curry from "./stdlib/curry.js";
import * as MyIntLib from "my-int-lib";
function add1(a) {
return MyIntLib.add(a, 1);
}
function sub1(a) {
return Curry._2(MyIntLib.sub, a, 1);
}
export {
add1 ,
sub1 ,
}
/* my-int-lib Not a pure module */
Where add1 is applied without currying and sub1 is applied with currying and the only difference is passing a signature vs inlining it.