From 08695b4765ef77f8b90a8c68bc7a166f69d22b10 Mon Sep 17 00:00:00 2001 From: Milad Date: Wed, 17 Jan 2024 14:10:02 -0500 Subject: [PATCH] [set] Add missing comments (#175) --- set/map.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/set/map.go b/set/map.go index b7a1139..fa110db 100644 --- a/set/map.go +++ b/set/map.go @@ -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() {