<div dir="auto">That's description on what any instance is expected to adhere to, not source.<div dir="auto"><br></div><div dir="auto">You can check source links on stackable too:<br></div><div dir="auto"><br></div><div dir="auto"><a href="https://www.stackage.org/haddock/lts-17.8/base-4.14.1.0/Data-Eq.html">https://www.stackage.org/haddock/lts-17.8/base-4.14.1.0/Data-Eq.html</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 2 Apr 2021, 16:38 Galaxy Being, <<a href="mailto:borgauf@gmail.com">borgauf@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">While learning about type classes, I tried to find the actual source code for Eq. In my beginner books this much is typically given<div><br></div><div><font face="monospace">class Eq a where<br> (==), (/=) :: a -> a -> Bool<br><br>-- Minimal completion definition:<br> x /= y = not (x == y)<br> x == y = not (x /= y)</font><br></div><div><br></div><div>I then found <a href="https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-Eq.html" target="_blank" rel="noreferrer">this</a> at <a href="http://hackage.haskell.org" target="_blank" rel="noreferrer">hackage.haskell.org</a>, but the "source" links are dead. On this page is a section of what I can't tell is either source code or just commentary on all the different mathematical ideas about equality, i.e., </div><div><br></div><div><font face="monospace">Reflexivity<br>x == x = True<br>Symmetry<br>x == y = y == x<br>Transitivity<br>if x == y && y == z = True, then x == z = True<br>Substitutivity<br>if x == y = True and f is a "public" function whose return type is an instance of Eq, then f x == f y = True<br>Negation<br>x /= y = not (x == y)</font><br></div><div><br></div><div>I would like to know if this is indeed in the source code or if it's just a sort of commentary. It looks important. Where can I find the actual source for all these basic type classes?</div><div><br></div><div>LB</div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>