Skip to content

Return unparsed numbers/scalar data? #28

@dylex

Description

@dylex

As a generalization or similar case of #22, I have cases where it would be nice to avoid (or delay) parsing of numeric data, with something like byteStringNumber :: Parser ByteString that "parsed" numbers (or even any scalar data would be fine) with just their original encoding. Looking at the code it seems the integer parsing at least happens in the C code very early, so I understand this is not straight-forward in the current implementation.

As a more general case, I'm looking to use this to do efficient JSON transformations (of large streaming ES search results), where you do something like "hits" .: "hits" .: arrayOf ("fields" .: rawByteStringObject) and get the raw ByteString (or tokenstream would be fine too) that you could then put back into a new json document (like with unsafeToEncoding) without having to parse it, like how ignore works but capturing the input somehow.

(Sorry for all the issues, and thanks for the library, just starting to use it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions