LinkedList as parent of Option
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
The type Option is kind of weird:
```m2
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:
```m2
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the existing Option type and its peek behavior, then compare them with the proposed LinkedList examples. Define how construction from a sequence, chained arrows, and peek should behave, and consider whether the internal representation should be a hash table or linked list; the examples in the issue describe the expected result.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100