Closed qjebbs closed 6 months ago
This approach doesn't seem great for end-user documentation.
This approach doesn't seem great for end-user documentation.
But I don't see any breaking changes to end users. It changes only the internal unexported underlying package imapnum.
On GoDoc, users will no longer see the various methods for UIDSet
and SeqSet
listed. They will just see the type alias, and will need to dig into the unexported package to find out what methods they can use and how they can iterate on the set.
Good point. We can implement SeqSet just like how UIDSet currently does instead of an alias.
That sounds better. The remaining downside is that the type definitions are more obscure than before now:
// before
type UIDSet []UIDRange
// after
type UIDSet numset.Set[UID]
So some internal types are leaked and it's less obvious that library users can for _, r := range set
.
Yes, it's kind of give and take. You are the one who ultimately makes the decision.
This is a POC to rewrite the
imapnum
package with generics.Benifits:
no need to covert from/to numset with "unsafe" package
Nums()
when override original:with generic: