[Haskell-cafe] ANN: bytestring-lexing 0.3.0

wren ng thornton wren at freegeek.org
Sun Jan 29 23:09:40 CET 2012


On 1/29/12 3:43 AM, Erik de Castro Lopo wrote:
> Would you consider a function with the following signature in
> bytestring-lexing?
>
>      readDecimalX :: Integral a =>  ByteString ->  a
>
> The idea is that it gives something faster for applications like Warp
> where reading an valid decimal should be as fast as possible, but if
> the string isn't valid it doesn't really matter what the result is.

If I can figure out a way to do so without too much code duplication I 
will. Another option would be to use the trick that's used by the pack* 
functions which causes the initial checks to be inlined ---and hence 
easily optimized away when used with fst.fromMaybe(0,"")--- without 
inlining the whole thing.

I'll keep you informed.

-- 
Live well,
~wren



More information about the Haskell-Cafe mailing list