-
Notifications
You must be signed in to change notification settings - Fork 52
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
Decompose GameState into sub-records #1510
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kostmo
added
the
Z-Refactoring
This issue is about restructuring the code without changing the behaviour to improve code quality.
label
Sep 10, 2023
kostmo
force-pushed
the
refactor/decompose-gamestate
branch
from
September 11, 2023 00:36
2d637cb
to
c1ff2f9
Compare
byorgey
approved these changes
Sep 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! It's a good idea in general, and I like the subcategories you have chosen to organize things. There are just two improvements I'd like to see:
- New subrecord types like
Temporal
,Landscape
, etc. should be exported (just the types, not their constructors or record fields) - We should put some effort into organizing the generated Haddock documentation. At the very least we should put each of the new subrecords + their lenses under a separate subheading in the export list.
Co-authored-by: Restyled.io <[email protected]>
kostmo
force-pushed
the
refactor/decompose-gamestate
branch
from
September 11, 2023 17:50
356b645
to
d6d5d79
Compare
kostmo
force-pushed
the
refactor/decompose-gamestate
branch
from
September 11, 2023 18:10
d6d5d79
to
0b51579
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merge me
Trigger the merge process of the Pull request.
Z-Refactoring
This issue is about restructuring the code without changing the behaviour to improve code quality.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Towards #872
Previously, the
GameState
record had41
toplevel members. It now has22
. Logical grouping of the fields makes it easier to peruse the code and paves the way to splitState.hs
into smaller modules. Some functions now may even be able to operate exclusively on subsets of the game state, rather than having to pass inGameState
as a whole.There is potential to go even farther, by extracting view-related and robot-related members to their own records, but I figured I'd pursue this refactoring incrementally.