Add `Stack`
- [x] Interface
- [x] Docs
- [x] Tests
- [x] Implementation
Queue, PQueue and Dequeue are split into Source/Sink interfaces to allow for Functor and Contravariant interfaces. This should probably have the same treatment?
Queue, PQueue and Dequeue are split into Source/Sink interfaces to allow for Functor and Contravariant interfaces. This should probably have the same treatment?
I thought about doing something like that, but TBH, not sure if it is really worth the effort.
IIRC, there is a general idea that the split of Queue didn't help that much, but I could be wrong.
Personally, I think that if you want to hide part of the interface and add extra functionality like map, that is better done in userland with a custom capability that encapsulates the Queue / Stack.
But, would love to hear what others think.