Skip to content

Removing and fixing imports and other warnings#1

Closed
Vlix wants to merge 20 commits intoavoid-warnings-with-CPPfrom
removing-and-fixing-imports-and-other-warnings
Closed

Removing and fixing imports and other warnings#1
Vlix wants to merge 20 commits intoavoid-warnings-with-CPPfrom
removing-and-fixing-imports-and-other-warnings

Conversation

@Vlix
Copy link
Copy Markdown
Owner

@Vlix Vlix commented Jun 9, 2025

Last part of yesodweb#1862


  • Mostly import removal / adjusting.
  • refactors to not get 'incomplete-uni-patterns' warning
  • NOTE TO SELF: REBASE FROM AND POINT PR TO yesodweb/yesod:master BRANCH WHEN OTHER TWO PRs ARE MERGED

Vlix added 13 commits June 15, 2025 14:45
Mostly found all the imports of 'Data.Monoid' and 'Data.Semigroup'
and removed as much as I can without breaking it.
Used CPP for backwards compatibility where needed.

Thought about using CPP to avoid deprecation warning of 'parseMonad',
but defining a helper function seemed way more straightforward.
- removed useless imports
- tried to avoid incomplete-uni-patterns with explicit 'error'
  calls for better error messages
- suppress warnings in tests
- add 'TypeOperator' pragma for type equality (~) usage
- few other things
…ances of 'FormResult' and 'AForm', while staying compatible with 'base >= 4.10'
@Vlix Vlix force-pushed the removing-and-fixing-imports-and-other-warnings branch from 556775a to 065a5be Compare June 15, 2025 13:09
@Vlix Vlix marked this pull request as ready for review June 15, 2025 13:13
@Vlix
Copy link
Copy Markdown
Owner Author

Vlix commented Jun 15, 2025

@parsonsmatt

This PR is also ready to review as it is rebased on top of the tweaked yesodweb#1876
If you merge in yesodweb#1876 first, I'll point this PR to the yesodweb repo. But if you feel both are fine to be merged, I'll merge this into yesodweb#1876 and then you can merge both at once?

@Vlix
Copy link
Copy Markdown
Owner Author

Vlix commented Jun 15, 2025

Ran a few more builds with extra warning flags and -Woperator-whitespace noticed a bit more issues.

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

import Yesod.Core
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Was removed erroneously in the first batch of pragma orderings

* lots of CPP and cleanup of 'Data.Monoid/Semigroup' stuff

Mostly found all the imports of 'Data.Monoid' and 'Data.Semigroup'
and removed as much as I can without breaking it.
Used CPP for backwards compatibility where needed.

Thought about using CPP to avoid deprecation warning of 'parseMonad',
but defining a helper function seemed way more straightforward.

* yesod-core: found a better solution with 'defaultRequest'

* removed a bunch of pragmas that weren't used

* removal of Semigroup stuff outside of libraries

* bump to 'base >= 4.11' on libraries that had Semigroup imports (and remove the imports)
@parsonsmatt
Copy link
Copy Markdown

I think you want to chage the target repository :)

@Vlix
Copy link
Copy Markdown
Owner Author

Vlix commented Jun 16, 2025

Reopened on yesodweb#1877

@Vlix Vlix closed this Jun 16, 2025
@Vlix Vlix deleted the removing-and-fixing-imports-and-other-warnings branch June 17, 2025 16:03
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