show4 i
| i >= 0 && i < 10 = "000" ++ show i
| i >= 0 && i < 100 = "00" ++ show i
- | i >= 0 && i < 1000 = "0" ++ show i
+ | i >= 0 && i < 1000 = '0' : show i
| i >= 0 && i < 10000 = show i
| otherwise = error ("show4: the integer i must satisfy 0 <= i < 10000: " ++ show i)
show2 :: Integral i => i -> String
show2 i
- | i >= 0 && i < 10 = "0" ++ show i
+ | i >= 0 && i < 10 = '0' : show i
| i >= 0 && i < 100 = show i
| otherwise = error ("show2: the integer i must satisfy 0 <= i < 100: " ++ show i)
= let h = offset `div` 60
m = offset - h * 60
in
- concat [show2 h, show2 m]
+ show2 h ++ show2 m
read4digitsTZ :: Stream s m Char => ParsecT s u m TimeZone
read4digitsTZ
hour <- read2
minute <- read2
let tz = TimeZone {
- timeZoneMinutes = (sign * (hour * 60 + minute))
+ timeZoneMinutes = sign * (hour * 60 + minute)
, timeZoneSummerOnly = False
, timeZoneName = timeZoneOffsetString tz
}
rfc2616DateAndTime
= choice [ liftM zonedTimeToUTC $ try rfc1123DateAndTime
, liftM zonedTimeToUTC $ try rfc733DateAndTime
- , liftM (localTimeToUTC utc) $ asctime
+ , liftM (localTimeToUTC utc) asctime
]