Read for integral types: proposed semantic change

David Feuer david.feuer at gmail.com
Sun Oct 9 05:15:17 UTC 2016


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" <winterkoninkje at gmail.com> wrote:

> 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 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/20161009/b75219be/attachment.html>


More information about the Libraries mailing list