func DistinctIntPtr(list []*int) []*int {
	var newList []*int
	s := make(map[int]struct{}, len(list))
	for _, v := range list {
		if _, ok := s[*v]; ok {
			continue
		}
		s[*v] = struct{}{}
		newList = append(newList, v)
	}
	return newList
}
DistinctIntPtr removes duplicates.
package fp