[Haskell-beginners] Baffled by Parsec

Colin Paul Adams colin at colina.demon.co.uk
Sun Feb 22 02:50:40 EST 2009

>>>>> "Felipe" == Felipe Lessa <felipe.lessa at gmail.com> writes:

    Felipe> On Sun, Feb 22, 2009 at 4:23 AM, Colin Paul Adams
    Felipe> <colin at colina.demon.co.uk> wrote:
    >> parse_integer :: Parser Int parse_integer = do digits <- many1
    >> digit let n = read digits return n

    Felipe> 'digits' come from 'digits <- many1 digit', and 'digit'
    Felipe> comes from Parsec itself[1] (and is the same as 'satisfy

Thanks. I meant digit, not digits.

    Felipe> [1]
    Felipe> http://hackage.haskell.org/packages/archive/parsec/3.0.0/doc/html/Text-Parsec-Char.html#v%3Adigit

OK - I see it here, but I was looking in
Text.ParserCombinators.Parsec.Char, where I can't see it (I can see
satisfy). I can't see how I am supposed to make that apparently
disconnected leap (other than by asking here, which works :-) )

Colin Adams
Preston Lancashire

More information about the Beginners mailing list