11 May 00:56
Re: Maybe a, The Rationale
From: PR Stanley <prstanley <at> ntlworld.com>
Subject: Re: Maybe a, The Rationale
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2008-05-10 22:56:48 GMT
Subject: Re: Maybe a, The Rationale
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2008-05-10 22:56:48 GMT
>> Paul: Hi folks >> >> data Maybe a = Nothing | Just a >> >> What is the underlying rationale for the Maybe data type? >> is it the >>safe style of programming it encourages/ >>Something tells me this is going to start a lengthy discussion.> > Bob: Pure and simple -- it allows you to represent partial > functions. >Looking up a map will only sometimes find a value, so we either return >Nothing, or Just that value. Paul: Would yu like to demonstrate this in an example? Cheers, Paul
>
> Bob: Pure and simple -- it allows you to represent partial
> functions.
>Looking up a map will only sometimes find a value, so we either return
>Nothing, or Just that value.
Paul: Would yu like to demonstrate this in an example?
Cheers, Paul
RSS Feed