<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 11, 2015 at 12:11 AM, Joel Neely <span dir="ltr"><<a href="mailto:joel.neely@gmail.com" target="_blank">joel.neely@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">So it would appear that the advice (per Kim-Ee) to add an "otherwise" as a third guard allows me to satisfy the compiler while documenting to the human reader that the definition is really complete without it.</blockquote></div><br></div><div class="gmail_extra">Thanks for the citation! But if you look at lots of haskell code, I don't think there's One Best Style on how to write haskell. E.g. I hardly ever use guards and I'm far from being alone. For the code in question I'd probably have ended up with an if expression, although I do see the structural elegance that guards bring here.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Another e.g. some will argue that the "right" approach is to collapse to 2 guards with the otherwise in the 2nd one. So the reader is expected to infer in a snap that if n is not < 10 then obviously it's >= 10.<br></div><div class="gmail_extra"><br></div><div class="gmail_signature">A "strong opinions, weakly held" strategy might work best. Be bold, make choices, trust in the warm diversity of the haskell universe.<br><br></div><div class="gmail_signature">Don Stewart has a nice list of coding styles here:<br><br><a href="http://stackoverflow.com/a/6399082">http://stackoverflow.com/a/6399082</a><br></div><div class="gmail_signature"><br>-- Kim-Ee</div><div class="gmail_extra"><div></div>
</div></div>