DEV Community

Discussion on: Advanced TypeScript Exercises - Question 1

Collapse
 
gillchristian profile image
Christian Gill • Edited

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.

Collapse
 
macsikora profile image
Pragmatic Maciej

Niiice :D

Collapse
 
mateiadrielrafael profile image
Matei Adriel

Yep, it's sad to see typescript missing so much from not having higher kinded types!

Collapse
 
gillchristian profile image
Christian Gill

We can do a lot already, right? But yeah, it'd be nice to have.

Collapse
 
jopie64 profile image
Johan

Can be simulated a bit though...

Thread Thread
 
mateiadrielrafael profile image
Matei Adriel

Wow, I was only familiar with the approach fp-ts took, its nice to see cool stuff like this:)