JuliaFolds / Transducers.jl

Efficient transducers for Julia
https://juliafolds.github.io/Transducers.jl/dev/
MIT License
432 stars 24 forks source link

Can't call `first` on collection using `withprogress` #526

Open tecosaur opened 2 years ago

tecosaur commented 2 years ago

It can be nice when developing a transducer chain to iteratively prototype it using first instead of the final reducer. This usually works fairly well, e.g.

1:4 |> Map(identity) |> Filter(iseven) |> first

However, the moment I introduce withprogress this stops working.

1:4 |> withprogress |> Map(identity) |> Filter(iseven) |> first
ERROR: MethodError: no method matching iterate(::Transducers.ProgressLoggingFoldable{UnitRange{Int64}})

It would be nice if I didn't have to remember to remove withprogress when prototyping and re-add it when processing the whole collection.