Closed oscbyspro closed 1 year ago
Tangentially, here's a cool idea I've had (, listen or hire me!). Wouldn't it be awesome if associated type constraints could also be used as opaque type constraints? Then I could just add requirements to ANKBinaryInteger.Words
and type-erase conforming types as follows:
var words: some ANKBinaryInteger.Words { ... }
This one's a bit though because
ANKWords
looks somewhat useful from afar, but I believe it can be cut after a closer look at it (#89). The reason it was added was to type-eraseANKFullWidth.Words
. I realize now, however, that/words
is unlikely to be used non-generically, sinceANKFullWidth
is itself an equivalent collection. At some point I added the0 ..< count
index constraint, but in the one place where I thought it would come in handy I ended up using a suffixing subsequence instead. Furthermore,ANKWords
should conform toSendable
, which means that it cannot constrain pointer algorithms. It's not completely useless, but I don't think it warrants a spot on the-list-of-things-I-need-to-understand-to-use-this-package.