fosskers / cl-transducers

Transducers: Ergonomic, efficient data processing
https://fosskers.github.io/cl-transducers/
GNU Lesser General Public License v3.0
100 stars 4 forks source link

More generic concatenate? #4

Open simendsjo opened 5 months ago

simendsjo commented 5 months ago

t:concatenate is bound to using lists as input, which doesn't make sense when all inputs are vectors and the reducer is t:vector. Should t:concatenate look at input to determine if t:list-reduce or t:vector-reduce should be used? Or hardcode knowledge of t:vector as reducer to convert input to a vector if needed?

I just copy/pasted t:concatenate to a version using t:vector-reduce and use that, but it's a bit dirty.

fosskers commented 5 months ago

Check out the first-pass of the PR I just pushed. I still need to add a proper Condition for when the input isn't a list/vector/string, as well as some unit tests.

fosskers commented 4 months ago

Hi there, any thoughts?

simendsjo commented 4 months ago

Hi there, any thoughts?

I have an alternative which works for all types of sources without hardcoding them: https://github.com/fosskers/cl-transducers/issues/8#issuecomment-2056741427