You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
summary: A Monoid instance uses a custom `mappend` implementation rather than re-using the default `(<>)` operation from its Semigroup instance.
4
+
severity: warning
5
+
flag: -Wnoncanonical-monoid-instances
6
+
introduced: 9.8.1
7
+
---
8
+
9
+
As part of the Semigroup Monoid proposal, the Semigroup class is now a
10
+
superclass of Monoid. Now, the `mappend` function is redundant and should
11
+
always do exactly the same as the `(<>)` function of the Semigroup instance.
12
+
In the future, the `mappend` function may even be removed completely.
13
+
14
+
So, you should adapt to these changes by either:
15
+
16
+
* Changing the definition of `mappend` to use `(<>)`. This is backwards compatible, but may break in the future.
17
+
* Removing the definition of `mappend` and rely on the default instance which uses `(<>)`. This is forwards compatible, but breaks your code for GHC 8.2 or earlier.
0 commit comments