[Haskell-cafe] Fast parsing of unboxed values without boxing them in the parser?
bos at serpentine.com
Tue Oct 23 06:50:02 CEST 2012
On Tue, Oct 23, 2012 at 3:26 AM, Eugene Kirpichov <ekirpichov at gmail.com>wrote:
> I'm thinking that a CPS-style parser type could allow returning an
> unboxed value as a result of the compiler inlining and fusing together
> the parsing code and the code that consumes the parsed value.
> Are there any libraries that work like this?
Both cereal (for binary) and attoparsec (text) are written in a CPS style
that can support this in principle. For parsers of even modest complexity,
GHC won't necessarily succeed at unboxing values, though; you have to
inspect the Core to see if what's going on matches what you're hoping for.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe