Skip to content

Generic Typesafe LinkedList #23591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ityonemo opened this issue Apr 17, 2025 · 1 comment
Open

Generic Typesafe LinkedList #23591

ityonemo opened this issue Apr 17, 2025 · 1 comment

Comments

@ityonemo
Copy link
Contributor

ityonemo commented Apr 17, 2025

After browsing some of the commentary here:
https://news.ycombinator.com/item?id=43679707

It seemed like a lot of people were concerned about the safety of the new linked list implementation. This PR includes SinglyLinkedList.Simple which is a generic wrapper over the SinglyLinkedLinkedList implementation details that enforces type safety and also provides a, possibly more intuitive type signature wherein the payloads themselves are added into the list.

If this is rejected, I don't mind, I think I only spent about 30 minutes on it.

#23590

@ityonemo
Copy link
Contributor Author

as a slight bikeshedding aside, when I was writing this code, I found it the name of the 'Node' datatype to be confusing, and would have rather 'Node' be the name of what is called 'Payload' in the 'Simple' implementation, with 'Node' being renamed to 'NodeInfo' or possibly 'Links'. However, this was not included in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant