Thanks for the comments! Very useful suggestions!
I haven't made up my mind yet about the query language. A "DSL" could be much simpler than the actual definition. For simple signatures there's no much change:
(type: string, id: string) => string
string, string => string
But for more complex ones it could become easier to type:
<A, B>(array: A, fn: ((a: A) => B)) => B
<A, B> A, (A => B) => B
But I did not consider the fact that it would mean learning something new. That is a strong argument.
Yeah a ML/NPL solution could also be the case. But I guess it makes more sense your your idea (which, btw, is really cool).
Yeah, I will definitely take a look at how other languages do and even how TS itself does the type resolution. Now I implemented something pretty naive. Will write a bit more in the coming week/s.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.