Open tgelu opened 5 years ago
@tycho01 has closed #78 which was very related to this.
I have the following silly array map
let map = <A, B>(f: (x: A) => B, ar: Array<A>) : Array<B> =>{ let next = ar.pop() return typeof next !== 'undefined' ? [f(next)].concat(map(f, ar)) : [] } let cmap = curry(map)
This works just fine until I curry it. Then, no matter how I call it typescript won't compile it with the following error:
error TS2365: Operator '+' cannot be applied to types '{}' and '5'. cmap(x => x + 5)([1, 2, 3])
Not even when I tell it that x is a number.
x
number
hm. I think there were issues on losing generics at the TS repo but can't recall which. I think the DT types for ramda have been catching up if not out-pacing this repo though. maybe try if those work better for you?
@tycho01 has closed #78 which was very related to this.
I have the following silly array map
This works just fine until I curry it. Then, no matter how I call it typescript won't compile it with the following error:
Not even when I tell it that
x
is anumber
.