- | Parse a number.
--
-- > [0-9]+|[0-9]*\.[0-9]+
--
-- Numbers may have the follwing format:
--
-- > 42, 4.2 or .42
--
num :: Parser String
num = try (do a <- many digit
              b <- string "."
              c <- many1 digit
              return $ (a ++ b ++ c)) <|> (many1 digit) <?> "number"

num :: Parser String
num = try (do a <- many digit
              b <- string "."
              c <- many1 digit
              return $ (a ++ b ++ c)) <|> (many1 digit) <?> "number"
num = try (do a <- many digit
              b <- string "."
              c <- many1 digit
              return $ (a ++ b ++ c)) <|> (many1 digit) <?> "number"