Reduce complexity for AI comprehension#222
Open
jappeace-sloth wants to merge 1 commit into
Open
Conversation
Extract shared patterns to reduce duplication and nesting, making functions understandable by smaller AI models (haiku-class) without needing surrounding context: - Render.hs: Extract createContainerNode helper for Column/Row/Stack which shared identical child-processing logic. - Animation.hs: Extract lerpNumProp/lerpColorProp where-helpers in interpolateStyle, replacing 6x repetitive 4-case pattern matches. Add doc comment specifying the (from,to) Maybe semantics. - SecureStorage.hs: Extract popCallback helper to flatten the nested readIORef/lookup/modifyIORef cascade in dispatchSecureStorageResult. No behaviour changes. Build and tests pass. Prompt: go apply your dumbify-my-code skill onto this project: https://github.com/jappeace/hatter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
createContainerNodehelper in Render.hs (Column/Row/Stack shared identical child-processing logic)lerpNumProp/lerpColorPropwhere-helpers in Animation.hs (replaced 6x repetitive 4-case pattern match with documented helpers)popCallbackhelper in SecureStorage.hs (flattened nested readIORef/lookup/modifyIORef cascade)No behaviour changes — pure readability refactoring verified by sending functions to a haiku-class model before and after.
Test plan
cabal buildpasses with no warningscabal testpasses (all test suites)🤖 Generated with Claude Code