clojuredesign-podcast

Discussions around the Functional Design in Clojure podcast - https://clojuredesign.club/
jumar 2020-10-06T06:35:42.006200Z

I listened to the partition-by & group-by episode and one thing you mentioned is using partition-by for "splitting" a sequence into two portions. Wouldn't split-with be a more suitable for that purpose? https://stackoverflow.com/questions/64208708/replicate-java-peek-stream-method-in-clojure

nate 2020-10-06T17:18:07.010Z

Yes, if you know that you will only get two portions, then split-with would work as well

bocaj 2020-10-06T14:30:36.009800Z

Looks like it depends on which data structure you're using, and laziness. Stackoverflow question was specifically about a side effect, so I think maybe they could use a queue instead of a list. I'm curious as well about the difference.

nate 2020-10-06T17:48:22.011300Z

I also think it's interesting that split-with returns a vector (eager) of two lazy sequences, so they are computed as you consume them