PARSER: allow normal Integers for posDouble as well
1.0 => valid 1 => valid
This commit is contained in:
parent
4877837f93
commit
70665e4b29
@ -69,11 +69,12 @@ posInt = MkParser f
|
|||||||
|
|
||||||
-- |Creates a Parser that accepts positive integers.
|
-- |Creates a Parser that accepts positive integers.
|
||||||
posDouble :: Parser Double
|
posDouble :: Parser Double
|
||||||
posDouble = read <$>
|
posDouble = read <$> (
|
||||||
liftA3 (\x y z -> x ++ [y] ++ z)
|
(\x y z -> x ++ [y] ++ z) <$>
|
||||||
(MkParser f)
|
(MkParser f) <*>
|
||||||
(char '.')
|
(char '.') <*>
|
||||||
(MkParser f)
|
(MkParser f) <|>
|
||||||
|
(MkParser f))
|
||||||
where
|
where
|
||||||
f xs
|
f xs
|
||||||
| null ns = Nothing
|
| null ns = Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user