https://code.lol/post/programming/typesafe-function-composit...
It's even more powerful if you restrict yourself to point free semantics - then you can use higher kinded types to do generic-level variadic composition.
As well, optional generics are trivially achievable in TS via default type parameters, unless I'm not understanding that section of the article.