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