Skip to content

Commit

Permalink
[set] Add missing comments (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
moorara authored Jan 17, 2024
1 parent 25439fb commit 08695b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion set/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package set

import "github.com/moorara/algo/generic"

// Mapper
// Mapper is a function for converting a member of a set from one type to another type.
type Mapper[T, U any] func(T) U

// Map converts a set from one type to another type.
// You need to provide a compare function for the new type.
func (f Mapper[T, U]) Map(s Set[T], equal generic.EqualFunc[U]) Set[U] {
members := make([]U, 0)
for _, m := range s.Members() {
Expand Down

0 comments on commit 08695b4

Please sign in to comment.