
I will surely take a look. Bertram Felgenhauer has come up with a nice
improvement to the Integer building algorithm; I don't know if you have
something better. Fractional stuff indeed looks very tricky; the current
code, however, seems unlikely to be taking the right approach.
On Oct 9, 2016 1:08 AM, "wren romano"
I totally agree that the desired semantics should be:
readsInt "12e-3" = [12,"e-3"] -- yes, there is an int at the beginning of the string. readsInt ('a' : ...) = [] -- yes, we can tell there isn't an int at the beginning of the string.
In terms of algorithms for parsing things efficiently as well as failing fast, I highly recommend looking at what bytestring-lexing does. Though the implementations there read in ByteStrings, there's nothing about the algorithms that depends on that representation. Getting efficient (and correct!) parsing for Fractional types is quite a lot more complicated than it looks on the surface.
-- Live well, ~wren _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries