Say I have an interface
interface Applicative<T> {}
Now I want to define a function f that:
Function
and takes a type U
extending an Applicative
wrapping any
U
wrapping Function
My naive attempts were
function f<U extends Applicative>(fn: Function, a: U<any>): U<Function>
and
function f<T, U<T> extends Applicative<T>>(fn: Function, a: U<any>): U<Function>
but none is valid
Can we have a Generic extend a type with a generic ?
No, typescript doesn't have higher-kinded types.
Duplicate of #1213 and probably others.
Duplicate of #1213 and probably others.
Yes it is. This can be closed