<div dir="ltr">In that same light, we're also missing packaged monoids for the bitwise (.|.), (.&.), xor (and the non-existent xnor) from Data.Bits. Bool is an instance of Bits. Extending this to these more general types you'd get:<div><br></div><div><div>newtype And a = And { getAnd :: a }<br></div><div>newtype Or a = Or { getOr :: a }</div><div>newtype Even a = Even { getEven :: a }</div><div>newtype Odd a = Odd { getOdd :: a }</div><div><br></div><div>Once things move to arbitrary bitwise operations, Even/Odd may not be the best names, though they do perform "vertical" bitwise parity checks.</div><div><br></div><div>While I don't have a particularly strong preference about whether those extra instances should live in Data.Monoid or Data.Bits, due to Monoid now being in Prelude, users do import Data.Monoid unqualified in rather more code than Bits. This would give me a slight preference to placing these in Data.Bits, but if one or the other would create an import cycle in base, I think it'd be fine to let that trump such a concern and force the placement.</div><div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 2, 2018 at 10:31 AM, 박신환 <span dir="ltr"><<a href="mailto:ndospark320@naver.com" target="_blank">ndospark320@naver.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt;font-family:NanumGothic,나눔고딕,sans-serif"><p>Logical XOR is associative, also is XNOR. And they both have an identity element.</p></div></blockquote></div></div></div>