Skip to content

Conversation

@andreasabel
Copy link
Member

Remove Control.Monad.Error, for transformers-0.6, enabled by mtl-2.3.

This breaks compilation with base <= 4.5 so I bumped the lower base to 4.6.
I tried to preserve compilation with base <= 4.5, but my attempts failed: no instance for Monad Result, where Result = Either <SomeTypeOfErrors>.
I suppose this instance was provided via a Monad instance for Either with an Error constraint in older base versions.
I tried these fixes to no avail:

  • base 4.4/4.5: importing the instance from Data.Either or Control.Monad.Instance: But this did not help, presumably because an Error constraint is needed? (Hard to get the history of the instance Monad (Either _), docs only show since base-4.4, but its definition could have changed.)
  • base-4.3: defining the instance myself, but this gives overlapping instances.

I have not tried

  • base-compat
  • definition a overlapping instance Monad Result: this is also hairy across GHC versions as:
    • Monad changed
    • the handling of overlapping instances changed

If it is important to preserve GHC 7.0-7.4 in new releases of HTTP, one could try harder.
But maybe it is ok to drop these. Legacy GHCs can use older versions of HTTP.

This PR is based on #140.

The constraints have been reorganized according to these principles:

- mention dependency on top-level if mentioned in all branches of a conditional
- do not repeat constraints in test-suite that are inherited from library
- order each dependency group alphabetically (but `base` and parent go first)
- format with leading comma (harder to make mistakes)
- align at >= and &&
    find . -name "*hs" | xargs fix-whitespace
instance Monad (Either e) isn't found when compiling with base <= 4.5
@hsenag
Copy link
Member

hsenag commented Feb 21, 2022

This looks good to me and I think dropping the old GHCs is overdue. Probably time for a major version bump (i.e. to 4000.4) to go with it to clearly signal the break. I'll drop the obsolete CIs following your last PR then merge this.

@hsenag hsenag merged commit 3e9af54 into haskell:master Feb 21, 2022
@andreasabel
Copy link
Member Author

@hsenag wrote:

Probably time for a major version bump (i.e. to 4000.4) to go with it to clearly signal the break.

Indeed, removal of instance Error warrants a major bump, see https://pvp.haskell.org/ :

Breaking change. If ... any instances were removed, then the new A.B MUST be greater than the previous A.B.

@hsenag
Copy link
Member

hsenag commented Feb 22, 2022

Indeed, removal of instance Error warrants a major bump

Good point!

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