Closed jerome-laforge closed 1 year ago
Is it possible with pie v2 to add First[T any](ss []T)?
First[T any](ss []T)
// First returns the first element or a zero value if there are no // elements. func First[T any](ss []T) T { if len(ss) == 0 { var zeroValue T return zeroValue } return ss[0] }
add the same with Last[T any](ss []T)
Last[T any](ss []T)
Sure, that makes sense. Feel free to put in a PR for these.
Is it possible with pie v2 to add
First[T any](ss []T)
?