From 70665e4b29da821d15a58e9fe2b31ac9d0dfd06f Mon Sep 17 00:00:00 2001 From: hasufell Date: Thu, 9 Oct 2014 16:53:32 +0200 Subject: [PATCH] PARSER: allow normal Integers for posDouble as well 1.0 => valid 1 => valid --- Parser/Core.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Parser/Core.hs b/Parser/Core.hs index 3fd78a6..54cacf6 100644 --- a/Parser/Core.hs +++ b/Parser/Core.hs @@ -69,11 +69,12 @@ posInt = MkParser f -- |Creates a Parser that accepts positive integers. posDouble :: Parser Double -posDouble = read <$> - liftA3 (\x y z -> x ++ [y] ++ z) - (MkParser f) - (char '.') - (MkParser f) +posDouble = read <$> ( + (\x y z -> x ++ [y] ++ z) <$> + (MkParser f) <*> + (char '.') <*> + (MkParser f) <|> + (MkParser f)) where f xs | null ns = Nothing