Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I know higher kinded types aren't currently supported by TypeScript and that there's an issue here for them. I found this npm package (hkts) which is designed to help with some cases; but unfortunately I haven't been able to get it to work for me.
Someone in the deno std lib achieved to make a deep merge which keep typing by infering a new type based on a merged T1 and T2, maybe you could take inspiration on it?
Yes, you can do this if you use a higher-kinded type for TestMergeFn instead of a function type. I'll use the HKT implementation from fps-ts because it has had more work put into it than hkts.
Related posts
- TypeScript: why you shouldn't throw errors to control the program flow
- Question about error handling in Typescript
- How to use advanced Typescript to define a `pipe` function
- Why doesn't typescript have a throws type to annotate functions that can throw an error?
- Is it possible to give utility types as arguments to other utlities?