Proposal: Add readMaybe (and possibly readEither) to Prelude, make Haddocks for read more cautionary

Edward Kmett ekmett at gmail.com
Fri Dec 30 04:56:30 UTC 2016


Read is one of very few classes with stated a deriving technique in the
Haskell Report.

Moving it out of the Prelude would break a ridiculous amount of code and
involve adding

import Text.Read

as boilerplate to the top of every single module of Haskell source code out
there that deigned to include

    deriving (Read,....)

among the list of instances derived for their data types.

The cure feels a lot worse than any disease. Heck, read isn't even a member
of the class, so this would just spite users and not even address the
symptom raised by this thread.

-Edward


On Thu, Dec 29, 2016 at 11:50 PM, David Menendez <dave at zednenem.com> wrote:

> On Thu, Dec 29, 2016 at 4:47 PM, Bardur Arantsson <spam at scientician.net>
> wrote:
>
>> On 2016-12-29 21:12, Andreas Abel wrote:
>> >
>> > I am in favor of deprecating "read" and pointing to a total version in a
>> > library.  Otherwise, I'd leave the Prelude unchanged.
>>
>
> This is also my preference. If we *have* to change the Prelude, I’d prefer
> moving Read out entirely.
>
> But that throws a wrench in the works of people who want to be "-Wall"
>> clean... unless you mean "deprecated" in the sense of being *documented*
>> as deprecated rather than actually marked as such (causing deprecation
>> warnings during compilation).
>>
>
> I don't think making life easy for -Wall clean people should be a goal.
> The whole point of warnings is that they indicate things that might not be
> a problem. Otherwise, they’d be errors. This is especially true for
> warnings that only show up if you use -Wall instead of -W.
>
> --
> Dave Menendez <dave at zednenem.com>
> <http://www.eyrie.org/~zednenem/>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20161229/c0bd2f42/attachment.html>


More information about the Libraries mailing list