AndWass / pushgen

Apache License 2.0
27 stars 4 forks source link

Should a `marker::NonstopGenerator` be added? #59

Closed AndWass closed 3 years ago

AndWass commented 3 years ago

Some functions, for instance reduce does not work properly when used with spuriously stopping generators. Should we add a marker trait that signals that a generator is not spuriously stopping, and only implement reduce for those generators?

AndWass commented 3 years ago

Another option is to add a NonstopGeneratorExt trait that contains the methods that aren't handling stopping generators gracefully.

NobodyXu commented 3 years ago

I think maybe the second option is better?

AndWass commented 3 years ago

Yah that's what I'm thinking as well. A third option is of course to continue having the methods in GeneratorExt and just document the behaviour. Which is probably the best from an ergonomic point of view.

AndWass commented 3 years ago

For now I will leave them in GeneratorExt and do nothing more about it.