This is part of the search algorithm (#14) but is worth to include it in a separated issue I believe.
There are a few consideration about matching generics that we should keep in mind
- Shouldn't be matched by name. The following two signatures should be considered the same. De Bruijn index can help here (I guess 🤔)
<T, U>(f: (t: T) => U) => (ts: T[]) => U[]
<A, B>(f: (a: A) => B) => (as: A[]) => B[]
- To simplify the queries I'd like to have the convention of considering single capital letters to be generics. E.g. the previous signatures should be searched by these queries:
(A => B) => A[] => B[]
(X => Y) => X[] => Y[]
- Default values of generics can be ignored (at least in the v1)
- Constraints of generics (i.e.
T extends Y) can be part of a latter iteration (ideally in v1 but not necessarily).
This is part of the search algorithm (#14) but is worth to include it in a separated issue I believe.
There are a few consideration about matching generics that we should keep in mind
T extends Y) can be part of a latter iteration (ideally in v1 but not necessarily).