[Haskell-cafe] Climbing up the shootout...

Don Stewart dons at galois.com
Mon Sep 22 20:36:55 EDT 2008


bulat.ziganshin:
> Hello Don,
> 
> Tuesday, September 23, 2008, 4:22:19 AM, you wrote:
> 
> > bulat.ziganshin:
> >> when gcc developers will start to add to C libraries functions
> >> performing shootout benchmarks we will continue this discussion :D
> 
> > atoi(3).
> 
> it isn't the same as readInt which was added specifically for this
> test. it doesn't support arbitrary-size streams and doesn't return
> rest of stream
> 

Hmm? That is wrong. These functions explicitly work on arbitrarily long
lazy bytestrings, and return the rest of the stream in a pair:

    readInt :: ByteString -> Maybe (Int, ByteString)
    readInteger :: ByteString -> Maybe (Integer, ByteString)

These are the initial parts of a bytestring lexing library, more of
which is appareing in the bytestring-lex package on Hackage.

-- Don


More information about the Haskell-Cafe mailing list