Skip to content

Alternative instances no longer require MonadPlus#106

Merged
L0neGamer merged 12 commits intohaskell:mainfrom
GregoryTravis:alternative
Apr 25, 2026
Merged

Alternative instances no longer require MonadPlus#106
L0neGamer merged 12 commits intohaskell:mainfrom
GregoryTravis:alternative

Conversation

@GregoryTravis
Copy link
Copy Markdown
Contributor

@GregoryTravis GregoryTravis commented Feb 7, 2026

Fixes #83 by requiring Alternative rather than MonadPlus in the Alternative instances for:

  • Accum
  • RWS/CPS
  • RWS/Lazy
  • RWS/Strict
  • Select
  • State/Lazy
  • State/Strict
  • Writer/CPS

Comment thread Control/Monad/Trans/RWS/CPS.hs Outdated
@GregoryTravis GregoryTravis requested a review from sjshuck February 7, 2026 20:52
@L0neGamer
Copy link
Copy Markdown
Collaborator

Could I ask for this to be rebased and then we can re-review?

@GregoryTravis
Copy link
Copy Markdown
Contributor Author

@L0neGamer ready for re-review.

@L0neGamer
Copy link
Copy Markdown
Collaborator

Looks like the CI caught some redundant constraints on some versions of ghc! Sorry for the slow feedback loop.

@GregoryTravis
Copy link
Copy Markdown
Contributor Author

MHs seems to require a Traversible import that ghc 9.14.1 doesn't want. Trying an ifdef.

@L0neGamer
Copy link
Copy Markdown
Collaborator

Darn, yeah that's an issue we have. Sorry, would you be able to leave it in without the cpp? We can live with some warnings until #117 is merged when MHS updates.

@L0neGamer
Copy link
Copy Markdown
Collaborator

Just needs to undo the removal of imports in Lift and I think we're good to go!

Copy link
Copy Markdown
Collaborator

@L0neGamer L0neGamer left a comment

Choose a reason for hiding this comment

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

Again, sorry for the back and forth. further review which should be the last thing:

restore Writer.Lazy's imports
restore Except's imports
restore Identity's imports
restore Maybe's imports
restore Reverse's imports

@L0neGamer
Copy link
Copy Markdown
Collaborator

Writer Strict will also fail ;-; I must apologise again

@GregoryTravis
Copy link
Copy Markdown
Contributor Author

Writer Strict will also fail ;-; I must apologise again

No problem -- what can I do to reproduce this locally so I can detect it myself?

@L0neGamer
Copy link
Copy Markdown
Collaborator

Installing mhs and mcabal and then do mcabal -r install in the directory

Copy link
Copy Markdown
Collaborator

@L0neGamer L0neGamer left a comment

Choose a reason for hiding this comment

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

Good to go!

@L0neGamer L0neGamer merged commit 49af4e8 into haskell:main Apr 25, 2026
18 checks passed
@L0neGamer
Copy link
Copy Markdown
Collaborator

Thank you for sticking by this!

@GregoryTravis
Copy link
Copy Markdown
Contributor Author

Thank you for sticking by this!

Thanks for your help!

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.

Why Alternative instances require MonadPlus?

3 participants