1

Do you think, that its a good idea, to add FP-features like Map,Filter,Reduce to Stack or Queue datastructures, in the way, that they pop all elements?

Comments
  • 2
    Reduce - maybe. Map and filter are not for stack. You will make stack not stack 🤔
  • 2
    No. You can always implement your own queue and stack or extend them but why change something that was built for a particular purpose?
  • 1
    So basically adding a future::stream like interface to them ? Makes sense to me
  • 0
    @CptFox
    From what languages is this, because I never heard if it ?
  • 3
    Queue - maybe
    Stack - fuck no, you should never have to stream a stack
  • 2
    @metamourge from Rust, futures are the equivalent of JS promises. futures::Stream is a trait (basically an interface) for a future that will resolve multiple times
  • 1
    @ganjaman That's also what I felt, but on the other hand, I really ever use stacks, so I wasn't comfortable talking a position about them
  • 1
    @CptFox i use them a lot, interpreters rely heavily on them
Your Job Suck?
Get a Better Job
Add Comment