Proposal: Add readMaybe (and possibly readEither) to Prelude, make Haddocks for read more cautionary
Ben Franksen
ben.franksen at online.de
Sat Feb 25 14:12:48 UTC 2017
Am 04.01.2017 um 04:59 schrieb David Menendez:
> On Tue, Jan 3, 2017 at 4:38 PM, Artyom <yom at artyom.me> wrote:
>> Deprecating `read` is a move in the opposite direction – it makes
>> hobbyists' lives harder while not changing anything for professionals
>> (because half of them probably uses an in-house or alternative Prelude and
>> another half can just grep for calls to `read` during the continuous
>> integration build).
>>
> Do a lot of hobbyists use read? I’m honestly curious: I keep being told
> that Read is only useful for parsing the output of Show, but I can’t
> imagine that comes up a lot. I guess I could see being useful for
> minimal-effort persistence, but parsers with no capacity for error messages
> make me uncomfortable.
I use it for numbers, mostly, typically command line arguments. Parsing
number is not trivial for floats (or decmal/hex/octal/etc).
Cheers
Ben
More information about the Libraries
mailing list