[Haskell-cafe] Why Maybe exists if there is Either?

Dan Frumin difrumin at gmail.com
Fri Jan 10 09:56:59 UTC 2014



> On 09 Jan 2014, at 20:52, Vlatko Basic <vlatko.basic at gmail.com> wrote:
> 
> Hi Brandon,
> 
> > ... you did not think out your program sufficiently beforehand ...
> Yes, that is quite possible. I consider myself an FP beginner still.
> I encountered that mixing Maybe and Either problem few months ago and I think it was about using parseUri and simpleHTTP and I had to `case` them separately to provide a meaningful error message. Haven't been able to simply chain them. In other words, it was not a nice looking function. 
> Maybe today I'd write it differently.

I suggest taking a loon at the 'errors' package mentioned earlier in this thread, it somewhat simplified my issues with unifying Maybe/Either/EitherT

> 
> > ... what exactly is the problem with using appropriate data types in appropriate places ...
> It is a good thing. Very good. But I do not think all library writers are using it in correct places. But that's another problem.
> 
> 
> vlatko
> 
>> -------- Original Message --------
>> Subject: Re: [Haskell-cafe] Why Maybe exists if there is Either?
>> From: Brandon Allbery <allbery.b at gmail.com>
>> To: Vlatko Bašić <vlatko.basic at gmail.com>
>> Cc: Johannes Erber <Hannes_E at gmx.de>, "haskell-cafe at haskell.org" <haskell-cafe at haskell.org>
>> Date: 09.01.2014 17:32
>> 
>> 
>> On Thu, Jan 9, 2014 at 11:25 AM, Vlatko Basic <vlatko.basic at gmail.com> wrote:
>>> > ... is letting the programmer do what they need to do with a minimum of fuss or extra work ...
>>> But doesn't the need of mixing Maybe and Either cause more work for the programmer? Programmer of library, or programmer using the library?
>> 
>> Arguably if you need to switch from Maybe to Either then you did not think out your program sufficiently beforehand. And if you did think it out, what exactly is the problem with using appropriate data types in appropriate places?
>> 
>> -- 
>> brandon s allbery kf8nh                                             sine nomine associates
>> allbery.b at gmail.com                                  ballbery at sinenomine.net
>> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140110/2f06252f/attachment.html>


More information about the Haskell-Cafe mailing list