[Haskell-beginners] Parsing an integer

Lyndon Maydwell maydwell at gmail.com
Sun Nov 21 21:59:05 EST 2010


I've found that the token library imposes conventions on whitespace
that make it difficult to use in many cases.

On Sun, Nov 21, 2010 at 11:19 PM, Tim Baumgartner
<baumgartner.tim at googlemail.com> wrote:
> Hi Stephen,
>
> yes, it's Parsec, but I write this parser only for learning the
> language, so I don't care if I rewrite existing code. But thanks for
> the advice regarding performance. Patrick's answer was perfect for me
> and I will get used to
>
> <$> = fmap
>
> soon.
>
> Tim
>
> 2010/11/21 Stephen Tetley <stephen.tetley at gmail.com>:
>> Where is the Parser monad coming from?
>>
>> If its Parsec, a "seasoned Haskeller" would avoid read (which is
>> re-parsing already parsed data) and use the integer parser from
>> Parsec's Token parser module.[*]
>>
>> [*] The one caveat is that the number parsers in this module follow
>> Haskell's lexical rules - you might not always want this.
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>


More information about the Beginners mailing list