tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
476 stars 29 forks source link

Add flux::unfold() #82

Closed tcbrindle closed 1 year ago

tcbrindle commented 1 year ago

fold() takes a sequence and a function and produces a single value; unfold() does the opposite -- it takes a single value and a function and produces a sequence.

This is basically the equivalent of the successors() function in Rust or views::generate() in Range-V3 (but without the race condition in the latter).

Thanks to Ben Deane for the name!

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (1c0dc6e) 97.85% compared to head (5bfe31d) 97.85%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #82 +/- ## ======================================= Coverage 97.85% 97.85% ======================================= Files 65 65 Lines 2191 2191 ======================================= Hits 2144 2144 Misses 47 47 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.