4 ms·
Can you map over this and preserve the NonEmptyArray type?
by throwaway09432 4y ago
Can you map over this and preserve the NonEmptyArray type?
- triyambakam 4y agoDo you mean pass in a type? type NonEmptyArray<T> = [T, ...T[]];
- throwaway09432 4y agoI mean if I have a NonEmptyArray say xs, and I then xs.map(x=>2*x), will the result of this expression be a NonEmptyArray ?
- triyambakam 4y agoNo, unfortunately it will just be number[] as the return type.