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

--
http://wagerlabs.com/





_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to