<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 26, 2015 at 11:26 AM, Shishir Srivastava <span dir="ltr"><<a href="mailto:shishir.srivastava@gmail.com" target="_blank">shishir.srivastava@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"><span style="font-size:12.8000001907349px">ok..but what's with using the keyword 'Just' ? why cannot 'Maybe' be defined like this </span><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">data Maybe a = a | Nothing<br></div></div></blockquote><div><br></div><div>Because type inference won't work if you don't have a distinction between an a and a Maybe a. Also, you end up back where you started --- there's a distinguished (non)value that appears to be a value of the type, which leaves you no better off than with C's NULL or Perl's undef, losing the type safety of "this can't fail" vs. "this may fail and you must deal with the failure somehow".</div><div><br></div></div>-- <br><div class="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></div>