[Haskell-cafe] Parsec float

Bartosz Wójcik bartek at sudety.it
Thu May 28 18:35:15 EDT 2009


Hi Everybody (especially Parsec Creator),

is there any reason why float parses only positive numbers?

I find following defition:

float           = lexeme floating   <?> "float"

floating        = do{ n <- decimal
                        ; fractExponent n
                        }

If floating was defined like

floating        = do{ n <- integer ...

or

floating        = do{ n <- int ...

instead  then it would parse negative ones as well.  

Best regards,
Bartek




More information about the Haskell-Cafe mailing list