Skip to content

Conversation

@memowe
Copy link
Owner

@memowe memowe commented Oct 29, 2025

No description provided.

@memowe memowe self-assigned this Oct 29, 2025
@memowe memowe marked this pull request as ready for review November 3, 2025 13:49
@memowe memowe requested a review from Copilot November 3, 2025 13:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the codebase to use Set instead of lists for clock collections and tag storage, improving type safety and ensuring uniqueness guarantees. The main changes include:

  • Replacing [Clock] with Set Clock (via Clocks type alias) throughout the codebase
  • Changing tag storage from [Tag] to Set Tag in the Clock data type
  • Updating dayGroups to return Map Day Clocks instead of [NonEmpty Clock]
  • Removing unused lastMaybe function and updating callsites to use S.maxView/S.findMax

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/T4/Data.hs Changed tags field to Set Tag, introduced Clocks type alias, updated dayGroups to return a Map, modified allCategories and allTags to return Sets
lib/T4/Storage.hs Updated function signatures to use Clocks, changed implementation to work with Sets including dayGroups Map structure
lib/T4/Report.hs Updated categoryDurations and tagDurations to accept Clocks instead of [Clock], adjusted selector functions to use Sets
lib/Util.hs Modified durations function to work with Set a instead of [a], removed unused lastMaybe function
lib/Completion.hs Changed complItems to Set a, updated complete to return Set a
exe-t4-commands/Commands.hs Updated to use Set operations (S.findMax, S.null) and Clocks type
exe-t5-interactive/TUI.hs Replaced lastMaybe usage with findMax helper using S.maxView, updated tag parsing to create Sets
test/T4/DataSpec.hs Updated test cases to work with Sets, including Clock construction and property tests
test/T4/StorageSpec.hs Modified tests to use Sets and updated assertions accordingly
test/T4/ReportSpec.hs Updated example data and property tests to use Sets
test/UtilSpec.hs Modified duration tests to use Sets, removed lastMaybe tests
test/CompletionSpec.hs Updated completion tests to work with Sets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@memowe memowe merged commit 2f886c5 into main Nov 3, 2025
2 checks passed
@memowe memowe deleted the clock-sets branch November 3, 2025 14:01
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