6

The Haskell parser/combinator Parsec supports input streams from Data.ByteString and Data.Text. Are there any plans to add more support for these types in future releases? The combinators (many, sepby, string...) seem to be designed around lists, and the reason one uses ByteStrings and Text in the first place is to get around the use of lists. I understand that most will convert with a pack and therefore the lists will be garbage-collected away, but isn't this just half-way support of Text/ByteString? Shouldn't there be a Data.Parsec.Text.Combinator and a Data.Parsec.ByteString.Combinator?

Mike Menzel
  • 583
  • 2
  • 12
  • I know about attoparsec, but it's not fully-featured enough for what I am parsing. – Mike Menzel Feb 07 '14 at 05:53
  • 1
    Can you give an example type signature for the specialized functions you have in mind? – Gabriella Gonzalez Feb 07 '14 at 06:02
  • 1
    Something like. many :: Stream s m t => ParsecT s u m Char -> ParsecT s u m Data.Text where the 0 length case would yield Text.empty. I know I could write one with a call to pack, but this would defeat the purpose of avoiding lists. – Mike Menzel Feb 07 '14 at 07:30

1 Answers1

2

To answer your question directly:

Are there any plans to add more support for these types in future releases?

Most probably, no. As is easy to infer from darcs changes, the package hasn't seen any active development for many years.

That said, the core API is exposed, so if you know what you want and how to do that, you can do it yourself.

Roman Cheplyaka
  • 37,738
  • 7
  • 72
  • 121