I'm trying to parse a string in haskell using Parsec.Combinator library. But I can't find how to parse a floating value. My function only reads integer (with digit, but digit only parses a integer value).
parsePoint :: Parser Point
parsePoint = do
string "Point"
x <- many1 digit
char ','
y <- many1 digit
return $ (Point (read x) (read y))
I searched for Text.Parsec.Number library but didn't find examples to how to use.
thanks for reading