cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

Add `Stack`

Open BalmungSan opened this issue 1 year ago • 2 comments

  • [x] Interface
  • [x] Docs
  • [x] Tests
  • [x] Implementation

BalmungSan avatar Aug 03 '24 19:08 BalmungSan

Queue, PQueue and Dequeue are split into Source/Sink interfaces to allow for Functor and Contravariant interfaces. This should probably have the same treatment?

reardonj avatar Aug 04 '24 12:08 reardonj

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.

BalmungSan avatar Aug 04 '24 14:08 BalmungSan