JuliaFolds / Transducers.jl

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

TakeExactly and TakeAtMost #488

Open jtrakk opened 3 years ago

jtrakk commented 3 years ago

A thought inspired by https://github.com/JuliaFolds/Transducers.jl/issues/481:

Take(n)

Take n items from the input sequence.

This makes me think 1:3 |> Take(10) would error. To make the behavior more self-explanatory it could be TakeAtMost(10) for the permissive version and TakeExactly(10) for the error?