Skip to content

Removing and fixing imports and other warnings#1877

Merged
parsonsmatt merged 24 commits intoyesodweb:masterfrom
Vlix:removing-and-fixing-imports-and-other-warnings
Jun 17, 2025
Merged

Removing and fixing imports and other warnings#1877
parsonsmatt merged 24 commits intoyesodweb:masterfrom
Vlix:removing-and-fixing-imports-and-other-warnings

Conversation

@Vlix
Copy link
Copy Markdown
Contributor

@Vlix Vlix commented Jun 16, 2025

Last part of #1862


  • Mostly import removal / adjusting.
  • refactors to not get 'incomplete-uni-patterns' warning
  • built with some extra warnings to catch more spots to tweak (e.g. -Woperator-whitespace)

Vlix added 23 commits June 9, 2025 16:44
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.
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'
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

import Yesod.Core
Copy link
Copy Markdown
Contributor 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

Copy link
Copy Markdown
Collaborator

@parsonsmatt parsonsmatt left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@parsonsmatt parsonsmatt merged commit 2570a91 into yesodweb:master Jun 17, 2025
13 checks passed
@Vlix Vlix deleted the removing-and-fixing-imports-and-other-warnings branch June 17, 2025 16:03
JBetz pushed a commit to JBetz/yesod that referenced this pull request Oct 13, 2025
* 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)

* 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-bin: got rid of other warnings

* yesod-core: remove warnings

- 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

* yesod-persistent: added 'TypeOperators' pragma and shuffled CPP to be more obvious

* yesod-form: added 'TypeOperators' pragma and simplified 'Monoid' instances of 'FormResult' and 'AForm', while staying compatible with 'base >= 4.10'

* removed a few unnecessary 'Control.Applicative' imports

* yesod-auth: equivalent refactors without warnings, extra pragmas and less shadowing

* yesod-form-multi: small cleanup

* yesod-test: fixed 'Control.Applicative' imports and fixed a uni-pattern warning

* yesod-auth*: more 'Control.Applicative' imports removed

* yesod-static: lots of import removal and a few better case expressions

* yesod: small refactor

* removing unused CPP pragmas and unnecessary 'MIN_VERSION_base(4,11,0)' parts

* yesod-auth: accidentally removed a pragma

* yesod-bin: removed unused libraries, added space around operator sections

* yesod-core: spaces around operator sections, use 'ifndef' instead of 'if !' in CPP

* yesod-form/-auth: add spaces around operators

* yesod-test: add spaces around operators
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