-
Notifications
You must be signed in to change notification settings - Fork 119
Two IntMap-related improvements #390
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
Conversation
It seems the only reason behind `IntMap ()` was the absense of `Data.IntMap.withoutKeys`, which was only added in `containers-0.5.8`.
At the moment we use `Data.IntMap` which is lazy in values, and we initialise values with thunks `testStatus <$> testActions`. This is outright silly: `testStatus` is just a selector for `TVar` field, forcing it to WHNF can do no harm. We also take an opportunity to replace `IntMap.fromList` with `IntMap.fromDistinctAscList`.
andreasabel
left a comment
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.
I suggest to hold the changes that need a bump to containers until we drop GHC 8.0.
|
@andreasabel good catch. I can put CPP of course, but I have no reason to keep compatibility with GHC < 8.6 (where 8.6 is only because of GHCJS). How do you feel about dropping earlier versions? |
|
Thinking it over, I guess it is fine to go ahead with this PR as-is. |
martijnbastiaan
left a comment
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.
Generally not a fan of fromDistinctAscList as it is easy to break the precondition, but given that the ascending list is right behind it this LGTM.
|
FWIW, looks good to me too! :) Thank you for the improvements! |
Version 1.5.3 -------------- _2025-01-05_ * Console reporter: disable line wrapping ([#433](UnkindPartition/tasty#433)). * Console reporter: force flushing of stdout after `showCursor` ([#436](UnkindPartition/tasty#436)). Version 1.5.2 -------------- _2024-11-03_ * Partially revert [#393](UnkindPartition/tasty#393) to fix progress reporting outside of Emacs. * Do not depend on `unbounded-delays` on `ppc64`, `s390x` and `riscv64` ([#371](UnkindPartition/tasty#371), [#422](UnkindPartition/tasty#422), [#423](UnkindPartition/tasty#423)). Version 1.5.1 -------------- _2024-06-22_ * Performance improvements ([#389](UnkindPartition/tasty#389), [#390](UnkindPartition/tasty#390)). * Progress reporting in Emacs: use `\r` instead of ANSI escape sequences ([#393](UnkindPartition/tasty#393)). * Console reporter: fix unintended change to `foldHeading` ([#396](UnkindPartition/tasty#396)). * Prune empty test subtrees from `TestTree` ([#403](UnkindPartition/tasty#403)). * Add `instance Eq Timeout` and `instance Ord Timeout` ([#415](UnkindPartition/tasty#415)). * Add ability to supply options for launchers and reporters at the top-level of test tree ([#417](UnkindPartition/tasty#417)).
launchTestTree: useIntMapstrict in valuesAt the moment we use
Data.IntMapwhich is lazy in values, and we initialise values with thunkstestStatus <$> testActions. This is outright silly:testStatusis just a selector forTVarfield, forcing it to WHNF can do no harm.We also take an opportunity to replace
IntMap.fromListwithIntMap.fromDistinctAscList.statusMapResult: useIntSetinstead ofIntMap ()It seems the only reason behind
IntMap ()was the absense ofData.IntMap.withoutKeys, which was only added incontainers-0.5.8.CC @martijnbastiaan for review