<html><head></head><body>There are a couple other ones that I'm less sure about.<br><br>cons:<br>   a <| ~(b :| bs) = a :| b : bs<br><br>Unsugared this is<br>   a <| bs = a :|<br>      (case bs of b :| _ -> b ) :<br>      case bs of _ :| bs -> bs<br><br>Would this make more sense?<br>   a <| bs = a :| case bs of b :| bs' -> b : bs'<br><br>Then <br>   cons x undefined = x :| undefined<br>not <br>   x :| undefined : undefined<br><br><br>groupBy1 matches strictly, could be lazy. (Is this a performance issue or an oversight?)<br>—<br>Sent from my phone with K-9 Mail.<br><br><div class="gmail_quote">On January 8, 2021 6:36:58 PM UTC, Keith <keith.wygant@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">Thanks, will do.<br><br>On January 8, 2021 5:07:25 PM UTC, David Feuer <david.feuer@gmail.com> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">The first one. Neither twiddles nor bangs are useful or add clarity.<br><br>On Fri, Jan 8, 2021, 11:53 AM Keith <keith.wygant@gmail.com> wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Currently:<br><br> head ~(a :| _) = a<br> tail ~(_ :| as) = as<br><br> But head and tail are both strict. At best the '~'s have no effect.<br><br> Should I open a PR to change it to<br><br> head (a :| _) = a<br> tail (_ :| as) = as<br><br> or maybe even more clearly<br><br> head !(a :l _) = a<br> tail !(_ :| as) = as<br><br> ?<br> --Keith<br> Sent from my phone with K-9 Mail. <br></blockquote></blockquote><br><br>Good to know! Wasn't aware that that was in the works.<br><br>And sorry for accidentally threading this onto something unrelated.<br><br>-- Keith<br>Sent from my phone with K-9 Mail.<br><br>On January 8, 2021 5:13:31 PM UTC, Henning Thielemann <lemming@henning-thielemann.de> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><br>On Fri, 8 Jan 2021, Keith wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">Currently:<br><br>head ~(a :| _) = a<br>tail ~(_ :| as) = as<br><br>But head and tail are both strict. At best the '~'s have no effect.<br><br>Should I open a PR to change it to<br><br>head (a :| _) = a<br>tail (_ :| as) = as<br><br>or maybe even more clearly<br><br>head !(a :l _) = a<br>tail !(_ :| as) = as<br><br>?<br></blockquote><br>The last one would trigger the "redundant bang pattern" warning that is <br>going to be implemented/released:<br>    <a href="https://gitlab.haskell.org/ghc/ghc/issues/17340">https://gitlab.haskell.org/ghc/ghc/issues/17340</a><br></blockquote></pre></blockquote></div></body></html>