in Education by (1.9m points)
I am very new to Haskell and am currently trying to solve a problem that requires some string parsing. My input String contains a comma-delimited list of words in quotes. I want to parse this single string into a list of the words as Strings. Where should I start learning about parsing such a String? Is there a partuclar module and/or functions that will be helpful?

p.s. Please don't post a full solution. I am just asking for a pointer to a starting place so I can learn how to do it.

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by (1.9m points)
The most powerful solution is a parser combinator. Haskell has several of these, but the foremost that come to my mind are:

parsec: a very good general-purpose parsing library

attoparsec: a faster version of parsec, which sacrifices the quality of error messages and some other features for extra speed

uu-parsinglib: a very powerful parsing library

The big advantage of parser combinators is that it is very easy to define parsers using do notation (or Applicative style, if you prefer).

If you just want some quick and simple string manipulation capabilities, then consult the text library (for high-performance byte-encoded strings), or Data.List (for ordinary list-encoded strings), which provide the necessary functions to manipulate strings.

Related questions

0 votes
0 votes
asked Apr 20 in Education by JackTerrance (1.9m points)
0 votes
asked Feb 27 in Education by JackTerrance (1.9m points)
...