[Haskell-cafe] advice on a parsing function

Manlio Perillo manlio_perillo at libero.it
Wed Mar 11 12:41:39 EDT 2009


minh thu ha scritto:
> [...]
> I suggest you try an alternative strategy.
> That altenrative strategy is twofold, just like you have
> quiz' and quiz'.
> This alternate strategy avoid pattern matching on strings
> (which would be cumbersome for a bit more complex syntax).
> 

But for this specific case it is very compact and elegant (IMHO).

> [...]
> Now, given those two functions, try to apply them
> on your input string, feeding the next function application
> with the resulting string of the current application.
> 

So, I should not split the string into lines?

An useful feature of my program is that it parses both an input like:

1:
1046323,2005-12-19

and
1:
1046323


If I write a parser from scratch I need to implement two separate functions.

I will give it a try, just to check if it has better performances.


Thanks  Manlio


More information about the Haskell-Cafe mailing list