[Haskell-cafe] attoparsec and parsec

Manlio Perillo manlio_perillo at libero.it
Sun Nov 15 08:19:37 EST 2009


Jason Dusek ha scritto:
>   To add to the confusion, I forked `bytestringparser` when I
>   wrote the `json-b` package. The fork is here:
> 
>     http://hackage.haskell.org/package/bytestringparser-temporary/
> 
>   I have added a number of things to original as well as fixing
>   some problems with it.
> 
>   The reason I went with the older package is that the new one
>   depended on stuff that wouldn't build on Hackage 

I installed attoparsec yesterday without problems.

> so I was like
>   "whatever"; however, I now consider that it might have been
>   better to work off the newer package.
> 
>   A subtle error, corrected in my version, seems yet to be
>   present in the `attoparsec-0.7.2`, in an operator used
>   internally to build up the result set.
> 
>     {-# LINE 132 "Data/Attoparsec/Internal.hs" #-}
>     -- | Turn our split representation back into a normal lazy ByteString.
>     (+:) :: SB.ByteString -> LB.ByteString -> LB.ByteString
>     sb +: lb | SB.null sb = lb
>              | otherwise = LB.Chunk sb lb
> 
>   Where this operator showed up in `bytestringparser`, I
>   replaced `LB.Chunk` with the smart constructor, `LB.chunk`, to
>   ensure that the "no empty chunks" invariant of lazy
>   `ByteString`s was followed (I discovered this failing one
>   evening when I was fleshing out the JSON parser).
> 

Did you try to contact the author/maintainer?
This test can be added to the test suite.



Thanks  Manlio


More information about the Haskell-Cafe mailing list