> If you just want to signalize a fail case without any additional > information, then a Maybe fits better than an Either, because > why should you need this bogus empty string?
Now it looks to me that it might be better and more consistent to write an empty bogus string (as with: nothing = Left "") than to have two distinct ways of error reporting, and both are used widely and often should be intermixed. And at the end, call site could decide does it want to use the string or not.
vlatko
-------- Original Message -------- Subject: Re: [Haskell-cafe] Why Maybe exists if there is Either? From: Daniel Trstenjak <daniel.trstenjak@gmail.com> To: haskell-cafe@haskell.org Date: 09.01.2014 16:13
> > Hi Vlatko, > > On Thu, Jan 09, 2014 at 03:50:16PM +0100, Vlatko Basic wrote: >> I'm curious to find out what was the reasoning to make Maybe? >> What is the added value with introducing it? >> In which situations the above substitution does not hold? > > If you just want to signalize a fail case without any additional > information, then a Maybe fits better than an Either, because > why should you need this bogus empty string? > > How should you know that the string doesn't contain something relevant? > > > Greetings, > Daniel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe