JuliaCollections / IterTools.jl

Common functional iterator patterns
Other
152 stars 28 forks source link

Add cached iterator #103

Closed pepijndevos closed 1 year ago

pepijndevos commented 1 year ago

For iterators that are expensive to compute and cheap to store, you might want to cache the result so the next time you iterate it just returns items from the cache. In a way this is kind of like lazy sequences from Clojure/Lazy.jl

This is missing documentation and tests but would like to gauge interest before committing time to that.

pepijndevos commented 1 year ago

Ehm... CI is running on Julia 0.7 and 1.0 neither of which allow const struct members on mutable structs.

codecov-commenter commented 1 year ago

Codecov Report

Merging #103 (4e3f858) into master (3cc0482) will increase coverage by 0.54%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   90.41%   90.96%   +0.54%     
==========================================
  Files           1        1              
  Lines         334      354      +20     
==========================================
+ Hits          302      322      +20     
  Misses         32       32              
Impacted Files Coverage Δ
src/IterTools.jl 90.96% <100.00%> (+0.54%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

oxinabox commented 1 year ago

Merging this presently

oxinabox commented 1 year ago

Hmm i have 2 more commits locally that haven't pushed, actually not merging this til I worked out why they haven't

oxinabox commented 1 year ago

Ah that worked to make them show up.