Closed mjarvis closed 1 year ago
Hey @mjarvis! A protocol definitely could be interesting if we come up with more identified collection conformances, but given that we have a single one, is there any reason you couldn't use the concrete type instead? Do you have some use cases in mind you could share?
@mjarvis I'm going to close this for now, since I'm having a hard time understanding the use case vs. a concrete type, but please open a discussion if you'd like to chat about it more, and then we can consider opening this PR again.
Sorry for the lack of response @stephencelis, if I find time to expand on this and provide the use cases I'll open a discussion.
Similar to swift protocols such as
Collection
,Sequence
, etc.This provides a protocol with the main functionality of
IdentifiedArray
for use in generic constraints for types which can support some protocol IdentifiedArray conforms to. (see example in tests usingT: Collection
), allowing types to provide specialized functionality for given containers.Before continuing on the todo list below, I wanted to provide this simple sample to see if this is something that would be considered for merge. I am currently using a similar protocol in a project by extending
IdentifiedArray
to conform outside of this package, but figured it may be useful for others.TODO:
@
attributes are needed/desired in protocol