Hi, Shishir,

As a recovering complexity addict (i.e. Java programmer ;-), I'd put it this way.

There are many methods (on many types) that can either succeed and return a meaningful value, or be unable to fulfill the intent of the caller's request. Example include indexOf on String get on Map, and read on a Reader. Every time such a partial function scenario occurs, the author must decide what to do if the intent can't be fulfilled. That freedom of choice has led to a proliferation of techniques.


Maybe provides a general, reusable solution to all such cases.

I don't think of Maybe as enabling a computation that is impossible otherwise, but I do regard it as providing a consistency and simplicity that is otherwise not present.

Hope this helps,
Joel


On Thu, Mar 26, 2015 at 5:06 AM, Shishir Srivastava <shishir.srivastava@gmail.com> wrote:
Hi, 

After reading and re-reading the haskell tutorials I don't happen to see a very convincing or appealing reason for having these data types. 

Can anyone please explain where Maybe and Just provide the sort of functionality that cannot be achieved in other languages which don't have these kind.

Thanks,
Shishir Srivastava


_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners




--
Beauty of style and harmony and grace and good rhythm depend on simplicity. - Plato