KiaraGrouwstra / typical

playground for type-level primitives in TypeScript
MIT License
173 stars 5 forks source link

operate on tuples #17

Open KiaraGrouwstra opened 6 years ago

KiaraGrouwstra commented 6 years ago

Array-like type operations are now clunky because we can't operate on tuples until https://github.com/Microsoft/TypeScript/issues/5453. When resolved, ditch much of the array module? Length could just use ['length'], for one. Currently tuple module is better with tuples (known length) but essentially neither approach is perfect.

KiaraGrouwstra commented 6 years ago

Closing as unactionable until we can do more about this.

goodmind commented 6 years ago

https://github.com/Microsoft/TypeScript/pull/24897

goodmind commented 6 years ago

@tycho01

KiaraGrouwstra commented 6 years ago

goodmind Thanks for linking me! It looks like we're still a while off for this though -- I responded there to lay out some of the gaps.

KiaraGrouwstra commented 6 years ago

I guess Concat handles spread in tuple literal types. looks like @fightingcat solved most of the tuple use-cases too! most interesting use-cases probably need that, so it's unfortunate it's so hacky (tricking the compiler into not seeing the recursion) it may well break.

I guess most of the cool stuff remains blocked on 6606, so I wonder what's unblocked now. path benefits maybe?