[Haskell-cafe] Re: Network parsing and parsec

Benjamin Franksen benjamin.franksen at bessy.de
Wed Sep 21 14:34:39 EDT 2005


On Wednesday 21 September 2005 20:17, John Meacham wrote:
> 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.

True, I forgot mmap. Taking a look at the implementation reveals that it 
indeed uses mmap (if available on the platform).

Ben


More information about the Haskell-Cafe mailing list