Curried 函数对于 Typescript 和 ramda 似乎不是类型安全的

Curried function seems not typesafe with Typescript and ramda

我有一个功能:

function myFunction(n: number, s: string, n2: number): boolean {
  throw ''
}

我使用 ramda 0.27.1 部分调用它:

const curriedStringNon = curry(myFunction)(123, 'string')

但后来我错过了一些类型安全:

curriedStringNon(123) // <- this is allowed which is expected
curriedStringNon('string') // <- this errors as it should
curriedStringNon() // <- but why is this allowed?

我不希望它编译,因为 myFunction 不能只用两个参数调用:

myFunction(123, 'string') // <- this also errors which is expected

正如我在评论中所说,

From Ramda's point of view, that's not an error. You just get back the function. This has been a point of contention even among the core team, but I'd argue that it's the most logical behavior.

I wrote several months ago that has some bearing on this.