TypeScript · Senior · Question 55 of 75
TypeScript has no higher-kinded types. How do libraries emulate F<A> where F is generic?
- ✓Correct answer: With a registry interface that maps a string "URI" to a type constructor, extended via declaration merging
- 2With
typeof F<A> - 3They can't - libraries only use
any
Explanation
fp-ts and Effect use such encodings to write functions generic over containers like Option or Array.