On Thu, Mar 26, 2015 at 11:26 AM, Shishir Srivastava <shishir.srivastava@gmail.com> wrote:
ok..but what's with using the keyword 'Just' ? why cannot 'Maybe' be defined like this 

data Maybe a = a | Nothing

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".

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net