3 ms·
Common usecase is mapping database schemas to "this is what SELECTs / INSERTs" should contain. eg https://github.com/jakearchibald/idb https://github.com/jakea
by Frotag 2y ago
Common usecase is mapping database schemas to "this is what SELECTs / INSERTs" should contain.
eg https://github.com/jakearchibald/idb https://github.com/jakearchibald/idb
Honestly most complicated types boil down to a handful of concepts (mapped types, conditionals, recursion) with a few tricks for working around sharp corners (deferring evaluation for performance, controlling whether a union distributes).
I've even seen someone solve 8-queens in types using a formal grammar but no clue how that worked. Speaking of, if anyone else has other examples of defining a grammar or ast in typescript, I'd love to see it.