Playground link. To avoid spoilers.
(On the phone so I re-wrote the example with Array)
I think the wrapper type cannot be generic. I mean the same solution wouldn't work for Promise and Array. Or at least I don't know a way.
Niiice :D
Yep, it's sad to see typescript missing so much from not having higher kinded types!
We can do a lot already, right? But yeah, it'd be nice to have.
Can be simulated a bit though...
Wow, I was only familiar with the approach fp-ts took, its nice to see cool stuff like this:)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Playground link. To avoid spoilers.
(On the phone so I re-wrote the example with Array)
I think the wrapper type cannot be generic. I mean the same solution wouldn't work for Promise and Array. Or at least I don't know a way.
Niiice :D
Yep, it's sad to see typescript missing so much from not having higher kinded types!
We can do a lot already, right? But yeah, it'd be nice to have.
Can be simulated a bit though...
Wow, I was only familiar with the approach fp-ts took, its nice to see cool stuff like this:)