You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, the CoalesceOrEmpty function is awesome, but it doesn't work for slices. Can we add a counterpart for CoalesceOrEmpty that works for nil/empty slices?
We could call it CoalesceOrEmptySlice and define it with standard generic types like the existing Coalesce:
func CoalesceOrEmptySlice[T ~[]E, E any](v ...T) (result T, ok bool) {
(Alternatively we could try removing the comparable limitation on the existing Coalesce, but I haven't tested whether that would work for nil slices)
The text was updated successfully, but these errors were encountered:
Hi, the CoalesceOrEmpty function is awesome, but it doesn't work for slices. Can we add a counterpart for
CoalesceOrEmpty
that works for nil/empty slices?We could call it
CoalesceOrEmptySlice
and define it with standard generic types like the existing Coalesce:(Alternatively we could try removing the comparable limitation on the existing Coalesce, but I haven't tested whether that would work for nil slices)
The text was updated successfully, but these errors were encountered: