JuliaFolds / Transducers.jl

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

Transducers produce type-unstable result. #551

Open AliceRoselia opened 1 year ago

AliceRoselia commented 1 year ago

high_primes = 0:wheel_size:PRIMELIMIT |> Map(x->lazyaddFilter(x,wheel_nums,sieve_primes)) |> TCat(length(wheel_nums)) |>Filter(x-> 1<x<=PRIMELIMIT)|>tcollect

A simple wheel sieve algorithm implemented with transducers is not type-stable. The result type is given as "ANY".

MasonProtter commented 1 year ago

@AliceRoselia Can you provide a minimal working example? i.e. definitions for lazyaddFilter, sieve_primes, wheel_nums, etc?

From what you've given it's very hard to track down what could be at play here and whether or not it has anything to do with Transducers.jl