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

Henning Thielemann lemming at henning-thielemann.de
Wed Dec 28 19:41:53 UTC 2016


On Wed, 28 Dec 2016, Yitzchak Gale wrote:

> But after some years of a frozen Prelude, many people feel that
> we have accumulated cruft, and that now the Prelude needs to
> be updated again to match modern practice. A sudden upheaval
> doesn't seem prudent, but incremental changes like this one that
> give a lot of benefit for little cost seem worthwhile.

What precisely is the problem of importing readMaybe and readEither from 
Text.Read? The current state means you have to import them, that is, you 
have to add one import line and this solution works back to GHC-7.6. If we 
add readMaybe and readEither to Prelude, you may be happy to not add a new 
import line but you force your library users to the newest version of GHC 
and you risk to make his programs uncompilable because it may depend on 
other packages that are not (yet) updated to the newest GHC. If you care 
for multiple versions of GHC you have to make much more cumbersome import 
statements or add multiple lines of preprocessor.

This seems to be too much effort if 'read' calls should be replaced by 
other functions anyway.


More information about the Libraries mailing list