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

small refactor: make BuildW a proper data type #275

Merged
merged 3 commits into from
Nov 26, 2023
Merged

Conversation

mitchellwrosen
Copy link
Collaborator

This PR just gives field names to each of the four components of a BuildW.

This would be a breaking change requiring a major version bump, except BuildW is conspicuously missing from the export list of Reactive.Banana.Prim.Mid - unless we say that module doesn't follow the PVP - but was not exporting BuildW intentional?

where
pulse = _nodeP pulse0
parent = _nodeP parent0

liftIOLater :: IO () -> Build ()
liftIOLater x = RW.tell $ BuildW (mempty, mempty, Action x, mempty)
liftIOLater x = RW.tell mempty { bwLateIO = Action x }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
liftIOLater x = RW.tell mempty { bwLateIO = Action x }
liftIOLater x = RW.tell emptyBuildW{ bwLateIO = Action x }

Two requests on the matter of record syntax:

  • mempty is too generic a name. Could you define emptyBuildW = mempty, so that it better resembles the BuildW constructor?
  • Record syntax messes a little with the "spaces separate distinct arguments" rule. Could you remove the spaces between the value and {? In this way, it becomes visually clear that { modifies the value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got it!

@HeinrichApfelmus
Copy link
Owner

BuildW is supposed to be an internal type — I'm happy to see it changed without bumping the version number. I consider Reactive.Banana.Prim.Mid to be an internal module not subject to the PVP also.

@mitchellwrosen
Copy link
Collaborator Author

@HeinrichApfelmus I think this is good to go

@HeinrichApfelmus HeinrichApfelmus merged commit 173cc76 into master Nov 26, 2023
6 checks passed
@HeinrichApfelmus
Copy link
Owner

Thanks! 😊

@HeinrichApfelmus HeinrichApfelmus deleted the buildw-type branch November 26, 2023 12:38
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.

2 participants