Open Harris-Miller opened 1 year ago
It is also worth noting that there are many places in @types/ramda
where there are typing for R.fn(__)
that is incorrect. See lt
for example
They have there
export function lt(__: Placeholder): (b: number, a: number) => boolean;
This implies that lt(__)
is the same as flip(lt)
, which is incorrect. Therefore, those type definitions will be removes as part of types-ramda
overall typing improvements
Or should we forbid using placeholder when use ramda with ts?
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59579
@adispring I read through that PR along with the links to the other discussions from there.
I don't have a particularly strong opinion on the keep/no-keep argument. However, the fact of the matter is that placeholders are supported, and therefore need to be typed out
The argument I made above was specifically for the use cases that don't really make sense to keep
R.divide === R.divide() === R.divide(R.__);
But I'm willing to bet that somewhere someone has implemented
const toPercent = R.divide(R.__, 100);
So removing Placeholder
support would break their code. Need to keep
ramda
's curry function is awesome but also has abilities that are not strictly necessary to typeThe use cases for both
R.divide()
andR.divide(R.__)
are however negligibleSo when typing out, we're only going to type it as:
And leave out