[Haskell-cafe] Re: Network parsing and parsec

John Meacham john at repetae.net
Wed Sep 21 14:17:41 EDT 2005


On Wed, Sep 21, 2005 at 12:32:56AM +0200, Benjamin Franksen wrote:
> On Tuesday 20 September 2005 16:50, John Goerzen wrote:
> > On the flip side, Parsec is really nice.  I wonder how easy it would
> > be to make it parse [Word8] instead of String?  
> 
> Isn't Parsec parameterized over the token type?
> 
> > Or even a 
> > FastPackedString? (And how easy it would be to get that instead of a
> > String from hGetContents)?
> 
> From the FPS haddock:
> 
> hGetContents :: Handle -> IO FastString
> 
>   Read entire handle contents into a FastString.
> 
> This may or may not do what you want...it's probably not a lazy read.

If it can be implemented via 'mmap' then it is effectivly a lazy read.
and _very_ efficient to boot.
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list