[Haskell-cafe] Re: Haskell Helper

Ozgur Akgun ozgurakgun at gmail.com
Mon Oct 4 19:25:55 EDT 2010

On 4 October 2010 23:54, c8h10n4o2 <asaferibeiro4 at ymail.com> wrote:

> By the way, there is a parser that returns [String] for my case?

If you are trying to parse strings (of alphaNum's) separated by commas, you
can use "many alphaNum" (or "many1 alphaNum" depending on what you want)
instead of simply using alphaNum. The type of the complete parser will then
be Parser [String].

alphaNum :: Parser Char

alphaNums :: Parser String
alphaNums = many alphaNum

alphaNums1 :: Parser String
alphaNums1 = many1 alphaNum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101004/d73c3c48/attachment.html

More information about the Haskell-Cafe mailing list