
5 Jan
2005
5 Jan
'05
8:36 a.m.
On Mon, Jan 03, 2005 at 08:48:26PM +0100, Henning Thielemann wrote:
What is the reason for the definition
ReadS a = [(a, String)]
not being
ReadS a = Maybe (a, String)
? The latter one reflects that either one or no value is read, whereas the first definition allows an arbitrary number of read values which is confusing and unsafe in my opinion.
Isn't that because there could be more than one way to read the string? For example, in theory reads of an int from "123" might return [(123,""), (12,"3"), (1,"23")] -- David Roundy http://www.darcs.net