<html><head></head><body>Perhaps it would make sense to have a 'using the class' section and a 'writing instances' section. <br>The first would focus on more concrete and intuitive examples.<br>The second would explain how and why to follow the laws, maybe with specific ways to avoid pitfalls and extra work (e.g. when you can and can't DeriveFoldable, when to use `foldMapDefault` when to define only `foldr` or `foldMap` or to use `toList` to define others.<br><br>It's super important that folks gan define legal instances so things don't brow up in their faces (e.g. an Applicative instance that zips but defines `pure` as a singleton). But often all they need to know is `DeriveTraversable` exists and works as long as you don't define things in strange ways (like conceptually reversed lists).<div style='white-space: pre-wrap'>--Keith<br>Sent from my phone with K-9 Mail.</div><br><br><div class="gmail_quote">On 17 September 2021 08:30:37 UTC, Ignat Insarov <kindaro@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre dir="auto" class="k9mail">Hello Viktor.<br><br>Thank you for your continuous effort.<br><br>I have been writing Haskell for years now and even getting paid for<br>it. I care nothing for the laws — I rarely apply equational reasoning.<br>I am a visual person, to me intuitive grasp is the tool of choice. I<br>also know a few newcomers to Haskell and I am certain they make zero<br>use of the laws.<br><br>My thus informed view is that laws are fine in the end and useless at the start.<br><br>On Fri, 17 Sept 2021 at 04:48, Viktor Dukhovni <ietf-dane@dukhovni.org> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><br>On Thu, Sep 16, 2021 at 06:51:42PM -0400, David Feuer wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">The last time I went to look at the laws it took me a couple minutes to<br>find them. I use them to write instances. Pretty important, IMO.<br></blockquote><br>I agree the laws are important to document, I just don't think they<br>belong at the top of the module.  The beginner to intermediate users<br>will be using the library and existing instances for some time before<br>they start to write their own instances.<br><br>If more modules adopt something like the style of the new Data.Foldable,<br>experienced users will know to look for the laws at the end, if not<br>still present at the top of the module.<br><br>Of course perhaps the community would prefer the original Laws first<br>format, I'm fine with that emerging as the consensus.  Perhaps worthy<br>of a separate thread (made it so).<br><br>Of course the conjectured users who might most benefit from not being<br>intimidated by being exposed to laws before they're ready to understand<br>them might not be present on this forum...<br><br>--<br>    Viktor.<hr>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">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>Only members subscribed via the mailman list are allowed to post.<br></blockquote><hr>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">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>Only members subscribed via the mailman list are allowed to post.</pre></blockquote></div></body></html>