Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Generators take 2 #1516

Merged
merged 3 commits into from
Jan 31, 2019
Merged

WIP: Generators take 2 #1516

merged 3 commits into from
Jan 31, 2019

Conversation

horenmar
Copy link
Member

Description

This PR reworks the generator interface to only require "Input" generators, as opposed to the old interface, that required "RandomAccess" generators. This means that the new interface can be easily fulfilled by generators that can only be iterated once per construction and only know whether they have more inputs when they try to prepare the next one, such as generators that read inputs from a file.

I am planning to add some extra generator adapters and more custom generator examples before merging this, but I want review for the design now.

Issues

N/A

@codecov
Copy link

codecov bot commented Jan 27, 2019

Codecov Report

Merging #1516 into master will increase coverage by 0.09%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
+ Coverage   80.53%   80.62%   +0.09%     
==========================================
  Files         121      120       -1     
  Lines        3436     3374      -62     
==========================================
- Hits         2767     2720      -47     
+ Misses        669      654      -15

@codecov
Copy link

codecov bot commented Jan 27, 2019

Codecov Report

Merging #1516 into master will increase coverage by 0.17%.
The diff coverage is 55.56%.

@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
+ Coverage   80.38%   80.54%   +0.17%     
==========================================
  Files         121      121              
  Lines        3409     3377      -32     
==========================================
- Hits         2740     2720      -20     
+ Misses        669      657      -12

@horenmar
Copy link
Member Author

I've added the generic generator adapters I've wanted to add, now I need to add some examples and documentation.

@horenmar horenmar force-pushed the dev-generators-take2 branch 2 times, most recently from 91030e3 to 5fa21dc Compare January 29, 2019 19:18
docs/generators.md Outdated Show resolved Hide resolved
docs/generators.md Outdated Show resolved Hide resolved
This means mutiple generic generators and some inference helper
* take(n, generator)
* filter(predicate, generator)
* map(func, generator)
* repeat(generator, repeats)
@horenmar horenmar force-pushed the dev-generators-take2 branch from 6c47de5 to 061f1f8 Compare January 31, 2019 09:51
@horenmar horenmar merged commit 63d1a96 into master Jan 31, 2019
@horenmar horenmar deleted the dev-generators-take2 branch January 31, 2019 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants