Also, blurring the lines between "type constructors" and "data constructors" as computation still leaves me as a little unsettled
^^ @arosien I had read through that talk once. Unfortunately I got busy and didn't follow up with writing my own example, which means I get to re-read through it again
That is always a good experience reading through or watching Rob's talks, though
my memories reset every month or two, so i'm in the same boat
is there a good reference bit of code on walking a driectory tree and say getting the size of the contents of each directory in a parallel controlled fashion? My problem is similar enough to that idea and I currently have 3 implementations: Non parallel but slow, parallel but blows up the paralleism exponentially based on the tree depth, parallel but blows up memory as it’s holding on to too much and not streaming. Wondering if there’s a prior work I could get a better sense of how to do this “right"
Great question, walk subtree for depth seems problematic, maybe limit total max number of ops at once via a semaphore and walk the exponential route.
good old semaphore. that sounds reasonable
you can use scatter-gather as well, with a queue of workers
Ivan Putera Masli
Hi, do fs2 supports detecting whenever a Stream is empty? An example use-case, if the stream is empty do some logging/warning.
@imasli that is not really compatible with what a Stream is, but it kinda depends on what you mean exactly. Would you mind expanding a bit more on your actual use case?
Hi - quick question. I have a Stream[F, Either[A,B]], and I'd like to take from the list until I have seen N Rights. Eg. Stream(Right, Left, Right, Right, Left, Right), with N of 2 would emit (Right, Left, Right). What's the easiest way of doing this?