Description
it.WithoutNth uses T comparable type constraint, but lo.WithoutNth correctly uses T any.
Since WithoutNth only operates on indices (nths ...int), it never compares T values, so the comparable constraint is unnecessarily restrictive and prevents using it.WithoutNth with non-comparable types (e.g., slices, maps, funcs).
Additionally, docs/data/core-withoutnth.md shows T comparable in the signature, which doesn't match the actual lo.WithoutNth code that uses T any.
Expected Behavior
it.WithoutNth should use T any to match lo.WithoutNth and allow non-comparable types.
Actual Behavior
it.WithoutNth requires T comparable, so code like this fails to compile:
go seq := slices.Values([][]int{{1, 2}, {3, 4}, {5, 6}}) result := slices.Collect(it.WithoutNth(seq, 1)) // compile error: []int does not satisfy comparable
Root Cause
it.WithoutNth calls RejectI (which uses T any) and lo.Keyify on nths ([]int). Neither requires T to be comparable. The constraint appears to have been copied from it.Without (which does need comparable).
Description
it.WithoutNthusesT comparabletype constraint, butlo.WithoutNthcorrectly usesT any.Since
WithoutNthonly operates on indices (nths ...int), it never comparesTvalues, so thecomparableconstraint is unnecessarily restrictive and prevents usingit.WithoutNthwith non-comparable types (e.g., slices, maps, funcs).Additionally,
docs/data/core-withoutnth.mdshowsT comparablein the signature, which doesn't match the actuallo.WithoutNthcode that usesT any.Expected Behavior
it.WithoutNthshould useT anyto matchlo.WithoutNthand allow non-comparable types.Actual Behavior
it.WithoutNthrequiresT comparable, so code like this fails to compile:go seq := slices.Values([][]int{{1, 2}, {3, 4}, {5, 6}}) result := slices.Collect(it.WithoutNth(seq, 1)) // compile error: []int does not satisfy comparableRoot Cause
it.WithoutNthcallsRejectI(which usesT any) andlo.Keyifyonnths([]int). Neither requiresTto becomparable. The constraint appears to have been copied fromit.Without(which does needcomparable).