I am trying to create a pipeline where audio files are read in, then a transformation is done which creates multiple versions of each audio file, and these are then saved. So as not to keep all audio files in memory at once, I want to use the laziness feature. But it seems that map seems to operate directly on the Thunks in the closure, and I don't know how to proceed there. The docs say that mapvalues works with lazy values (they don't say that map doesn't) but I have to do return a FileTree with my new files, and that doesn't work with mapvalues.
I am trying to create a pipeline where audio files are read in, then a transformation is done which creates multiple versions of each audio file, and these are then saved. So as not to keep all audio files in memory at once, I want to use the laziness feature. But it seems that
mapseems to operate directly on theThunksin the closure, and I don't know how to proceed there. The docs say thatmapvaluesworks with lazy values (they don't say thatmapdoesn't) but I have to do return aFileTreewith my new files, and that doesn't work withmapvalues.