Skip to content

Commit

Permalink
Merge pull request #129 from Primetalk/pair-both2
Browse files Browse the repository at this point in the history
feat: add pair.Both()
  • Loading branch information
Primetalk committed Feb 8, 2023
2 parents 8c750a2 + a024ed7 commit dc40d1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fun/pair.go
Expand Up @@ -17,6 +17,11 @@ func PairV2[A any, B any](p Pair[A, B]) B { return p.V2 }

// PairBoth returns both parts of the pair.
func PairBoth[A any, B any](p Pair[A, B]) (A, B) {
return p.Both()
}

// Pair.Both returns both parts of the pair.
func (p Pair[A, B]) Both() (A, B) {
return p.V1, p.V2
}

Expand Down

0 comments on commit dc40d1d

Please sign in to comment.