@@ -23,10 +23,12 @@ parsePositive s = parsePosTrimmed (trim s)
2323 where
2424 parsePosTrimmed s with (strM s)
2525 parsePosTrimmed "" | StrNil = Nothing
26+ parsePosTrimmed (strCons '+' xs) | (StrCons '+' xs) =
27+ map fromInteger (parseNumWithoutSign (unpack xs) 0)
2628 parsePosTrimmed (strCons x xs) | (StrCons x xs) =
27− if (x == '+')
28− then map fromInteger (parseNumWithoutSign (unpack xs) 0)
29− else map fromInteger (parseNumWithoutSign (unpack xs) (cast (ord x - ord '0')))
29+ if (x >= '0' && x <= '9')
30+ then map fromInteger (parseNumWithoutSign (unpack xs) (cast (ord x - ord '0')))
31+ else Nothing
3032
3133
3234||| Convert a number string to a Num.