BioJulia / BioSequences.jl

Biological sequences for the julia language
http://biojulia.dev/BioSequences.jl
MIT License
150 stars 47 forks source link

Implement `findall` #217

Closed jakobnissen closed 2 years ago

jakobnissen commented 2 years ago

We don't have this function, but we might as well. We might want to not return a Vector of results but a lazy iterator though (what's up with Base needlessly materializing everything?!)

TransGirlCodes commented 2 years ago

Isn't there an iterator in Base.Iterators that does the lazy equivalent?

jakobnissen commented 2 years ago

I can't find any findall-functionality in Base.Iterators we can use specifically, but yes, Base has a long tradition of first implementing something that materializes the result, then years later realizing you actually also need the non-allocating, and then having two implementations (instead of just implementing the non-allocating first, and then implementing the allocating by simply calling the former, then using collect).