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

Moved pull implementation from stream.hpp to new file pull.hpp #10

Open
wants to merge 1 commit into
base: tidy/stream
Choose a base branch
from

Conversation

codeinred
Copy link
Collaborator

This is a more major refactoring of stream.hpp, which is why I'm doing it on it's own branch, and initiating a pull request. This branch splits the implementation of stream and pull into separate files. It also removes the function pull.toStream(), which just invoked stream's constructor. This created an unnecessary cyclic dependency between the two classes. All instances of pull.toStream() were replaced with a direct call to streams constructor.

Questions:

  • What is bot (declared as an empty union), and how does it differ from top (declared as using top = std::monostate)?
  • Can we remove eff.hpp? It doesn't seem to do anything. It contained the definitions for bot and top, but I moved those into stream.hpp and pull.hpp respectively.

This refactor required removal of pull.toStream(), which only invoked stream's constructor.

pull.toStream() was only used in a few places inside stream, and I felt that it added an unnecessary cyclic dependency between the two classes.
@codeinred codeinred requested a review from s5bug August 5, 2021 04:09
@codeinred codeinred mentioned this pull request Aug 5, 2021
@s5bug
Copy link
Owner

s5bug commented Aug 5, 2021

top = top type, meaning it has only one inhabitant. An example of top is a struct with no fields. The only inhabitant is the single empty struct.

bot = bottom type, meaning it has zero inhabitants. An example of bot is a union with no entries. There's no way to initialize this union. (So, a task<bot> is a task that never completes. A vector<bot> can only ever be an empty vector. Etc.)

@s5bug
Copy link
Owner

s5bug commented Aug 5, 2021

Regardless, pull should not be exposed as a primary type. I will explain why in tidy/stream.docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants