Skip to content

refactor: Simplify and clean up Haskell codebase#175

Draft
srid wants to merge 1 commit intomasterfrom
elegance-cleanup
Draft

refactor: Simplify and clean up Haskell codebase#175
srid wants to merge 1 commit intomasterfrom
elegance-cleanup

Conversation

@srid
Copy link
Copy Markdown
Owner

@srid srid commented Mar 21, 2026

Summary

Code elegance pass across the codebase, generated using the /elegance command.

  • Extract duplicated lock-and-update pattern in Dynamic.hs into lockedUpdate/keepAlive helpers
  • Unify duplicate FromMaybe type family (remove from Generic.hs, export from Symbol.hs)
  • Simplify decodeUrlRoute using first over Either instead of manual case matching
  • Replace if-then-else with when/unless/unlessM where clearer
  • Remove dead commented-out logging code in Prism/Check.hs
  • Extract duplicated REDIRECT message in WebSocket.hs
  • Clean up redundant imports, parens, and intermediate bindings
  • Fix typos: isomoprhic, isomporphic, tyupe
  • Rewrite FromJSON UrlStrategy with explicit case matching and proper error message

Test plan

  • nix run github:juspay/vira -- ci -b passes

- Extract duplicated lock pattern in Dynamic.hs into lockedUpdate/keepAlive helpers
- Unify duplicate FromMaybe type family (Generic.hs → Symbol.hs)
- Simplify decodeUrlRoute using `first` over Either
- Replace if-then-else with when/unless/unlessM where clearer
- Remove dead commented-out code in Prism/Check.hs
- Extract duplicated REDIRECT message in WebSocket.hs
- Clean up redundant imports, parens, and intermediate bindings
- Fix typos: isomoprhic, isomporphic, tyupe
- Rewrite FromJSON UrlStrategy with explicit case matching
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.

1 participant