<div dir="ltr">It is, yes. (Literal numbers in patterns occasionally have unexpected type ramifications as a result; and occasionally others, since the compiler rewrites the pattern match into a guard. It's one of those things that Just Works 99% of the time and then makes you tear your hair out.)</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 9:56 PM, Harendra Kumar <span dir="ltr"><<a href="mailto:harendra.kumar@gmail.com" target="_blank">harendra.kumar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">My first guess was a pattern match, but it sounded a bit odd because there is no explicit constructor in case of numbers.  If there were an explicit constructor it would have been easier to imagine this as a pattern match. This seems to be a weird side effect of the special handling of numbers.<span class="HOEnZb"><font color="#888888"><div><br></div><div>-harendra</div></font></span><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 24 February 2017 at 07:37, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar <span dir="ltr"><<a href="mailto:harendra.kumar@gmail.com" target="_blank">harendra.kumar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Kids have this amazing ability to break any toy in minutes. I gave my seven year old daughter ghci to play with and in a little while she said it is broken:<div>







<p class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-p1"><span class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-s1">>> let 1 = 2</span></p>
<p class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-p1"><span class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-s1">>> 1</span></p>
<p class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-p1"><span class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-s1">1</span></p>
<p class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-p1"><span class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-s1">>> </span></p><p class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-p1"><span class="m_2025218079870128664m_-1919096904227003041m_3749249878251812522gmail-s1">Earlier, I had explained to her about symbols and assigning values to symbols, and I said numbers are not symbols. But when she came up with this I could not explain what's going on. How can "1 = 2" be a valid equation? Am I missing something fundamental here, or it is just broken?</span></p></div></div></blockquote></span><div>It's a pattern match. The match fails, but as it produced no bindings it cannot be observed and its success or failure is irrelevant. <span class="m_2025218079870128664HOEnZb"><font color="#888888"><br></font></span></div></div><span class="m_2025218079870128664HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_2025218079870128664m_-1919096904227003041gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</font></span></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div>