I\'m using typescript generics and I\'d like to infer the type of fn aka P, however it\'s not working as I\'d expect.