Skip to content
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

LinkedList as parent of Option #3537

Open
mahrud opened this issue Oct 25, 2024 · 0 comments
Open

LinkedList as parent of Option #3537

mahrud opened this issue Oct 25, 2024 · 0 comments

Comments

@mahrud
Copy link
Member

mahrud commented Oct 25, 2024

The type Option is kind of weird:

i1 : new Option from {1,2,3}

o1 = 1 => 2

o1 : Option

i2 : peek oo

o2 = Option{1, 2, 3}

i3 : 1 => 2 => 3

o3 = 1 => 2 => 3

o3 : Option

i4 : peek oo

o4 = Option{1, 2 => 3}

I think something more useful would be a generalization like LinkedList that behaves like this:

i1 : new LinkedList from {1,2,3}

o1 = 1 => 2 => 3

o1 : LinkedList

i2 : 1 => 2 => 3

o2 = 1 => 2 => 3

o2 : LinkedList

i3 : peek oo

o3 = LinkedList{1 => 2}
                2 => 3

This could be implemented internally simply as a hash table or even an actual linked list.

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