
5 Apr
2007
5 Apr
'07
11:14 a.m.
Shouldn't this work just as well? numExpr = choice [ try $ float >>= return . Num , integer >>= return . Int ] It works on "Foo(10.345)" but not on "Bar(10, 103.34)". On Apr 5, 2007, at 4:09 PM, Stefan O'Rear wrote:
numExpr :: GenParser Char a NumExpr numExpr = do sg <- lexeme sign nf <- natOrFloat return $ either (Int . sg) (Nat . sg) nf
It seems silly that there is no signed version of natOrFloat predefined, any Parsec experts?
Stefan