-
Notifications
You must be signed in to change notification settings - Fork 703
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
Fix Monoid instances for ForeignLib & Executable #9555
Conversation
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.
Well spotted, target monoids have many quirks.
@mergify rebase |
❌ Unable to rebase: user
|
@mergify rebase |
✅ Branch has been successfully rebased |
@alt-romes: apparently the |
Hmm, something is still borked. |
@mergify refresh |
✅ Pull request refreshed |
github Actions are having problems: "Error: Internal server error occurred while resolving "actions/cache@v3". Internal server error occurred while resolving "actions/checkout@v4". Internal server error occurred while resolving "actions/upload-artifact@v3". Internal server error occurred while resolving "haskell-actions/setup@v2"" Let's just wait it out. |
@mergify rebase |
❌ Unable to rebase: user
|
@mergify rebase |
✅ Branch has been successfully rebased |
@mergify rebase |
✅ Branch has been successfully rebased |
The Semigroup and Monoid instances for ForeignLib were completely broken: for the `foreignLibVersionInfo` and `foreignLibVersionInfo`, we essentially had the following: mempty :: Maybe XYZ mempty = Nothing (<>) :: Maybe XYZ -> Maybe XYZ -> Maybe XYZ _ <> b = b which is obviously not a valid Monoid, as `Just x <> Nothing = Nothing`, violating the identity law. The Semigroup instance for Executable was also deeply suspicious, as it combined the module paths, which makes no sense. Now we instead error if the two module paths are different (and both nonempty).
The
Semigroup
andMonoid
instances forForeignLib
were completely broken: for theforeignLibVersionInfo
andforeignLibVersionInfo
, we essentially had the following:which is obviously not a valid
Monoid
, asJust x <> Nothing = Nothing
, violating the identity law.The
Semigroup
instance forExecutable
was also deeply suspicious, as it combined the module paths, which makes no sense. Now we instead error if the two module paths are different (and both nonempty).