It would be a lovely addition if partition were aware of type guard functions. Something like this
export function partition<A>(
xs: ReadonlyArray<A>,
predicate: (value: A) => boolean
): [A[], A[]];
export function partition<A, B extends A>(
xs: ReadonlyArray<A>,
predicate: (value: A) => value is B
): [B[], Exclude<A, B>[]];
I thought it might be sufficient to drop this in https://github.com/mobily/ts-belt/blob/master/src/Array/Array.ts but I'm not confident enough to open it as a PR without being able to test locally and the tooling for this project is new to me so I couldn't afford to invest the time in getting it set up yet.
It would be a lovely addition if
partition
were aware of type guard functions. Something like thisI thought it might be sufficient to drop this in https://github.com/mobily/ts-belt/blob/master/src/Array/Array.ts but I'm not confident enough to open it as a PR without being able to test locally and the tooling for this project is new to me so I couldn't afford to invest the time in getting it set up yet.