Thanks @jihchi , that is close to what I wanted, but it is still not what I wanted. I checked that using a record produces literally the same output and has a nicer rescript syntax:
type options = {destinationFolder: string, fileFullPath: string}
let determineDestinationPathKeepingFolderStructure = (options: options) => {
let destinationFolder = options.destinationFolder
let fileFullPath = options.fileFullPath
let commonPath = commondir([destinationFolder, fileFullPath])
Node.Path.join2(destinationFolder, fileFullPath->Js.String2.replace(commonPath, "./"))
}
However, my problem is that both outputs are not producing destructuring on the function arguments. This is very important because gives very interesting hints of the expected inputs just with the function signature. Take a look at the difference on the generated intellisense between the RS output:
I tried gentype already, and indeed it was generating the expected function signature. However it also adds some unnecessary overhead by wrapping the function on another function and on top of that it also curries and calls the original function. Too much unneeded wrapping for my taste.