@@ -125,9 +125,8 @@ getOlsonPart verifyMagic getTime = do
125125 (version,
126126 OlsonData
127127 (zipWith Transition times indexes)
128− (map (flip lookupAbbr abbr_chars) . zipWith setTtype ttinfos .
129− (++ repeat UnknownType) $
130− zipWith boolsToTType (map Just isstds ++ repeat Nothing) isgmts)
128+ (map (flip lookupAbbr abbr_chars) . zipWith setTtype ttinfos $
129+ zipWithExtend boolsToTType False False isstds isgmts)
131130 leaps
132131 Nothing
133132 )
@@ -135,11 +134,18 @@ getOlsonPart verifyMagic getTime = do
135134 lookupAbbr (TtInfo gmtoff isdst ttype abbrind) =
136135 TtInfo gmtoff isdst ttype . takeWhile (/= '\NUL') . drop abbrind
137136 setTtype ttinfo ttype = ttinfo {tt_ttype = ttype}
138− boolsToTType _ isgmt | isgmt = UTC
139− boolsToTType isstd _ = maybe UnknownType stdOrWall isstd
140− stdOrWall isstd
141− | isstd = Std
142− | otherwise = Wall
137+ boolsToTType _ isgmt | isgmt = UTC
138+ boolsToTType isstd _
139+ | isstd = Std
140+ | otherwise = Wall
141+
142+-- A variant of zipWith whose result is the length of the longer
143+-- rather than the shorter list, by extending the shorter list with
144+-- a default value
145+zipWithExtend :: (a -> b -> c) -> a -> b -> [a] -> [b] -> [c]
146+zipWithExtend f x0 y0 (x:xs) (y:ys) = f x y : zipWithExtend f x0 y0 xs ys
147+zipWithExtend f x0 _ [] ys = map (f x0) ys
148+zipWithExtend f _ y0 xs _ = map (flip f y0) xs
143149
144150-- Parse a POSIX-style TZ string.
145151-- We don't try to understand the TZ string, we just pass it along whole.
@@ -160,7 +166,7 @@ getTtInfo = do
160166 gmtoff <- get32bitInt
161167 isdst <- getBool
162168 abbrind <- get8bitInt
163− return $ TtInfo gmtoff isdst UnknownType abbrind
169+ return $ TtInfo gmtoff isdst Wall abbrind
164170
165171-- Parse leap second info. (usually not used)
166172getLeapInfo :: Integral a => Get a -> Get LeapInfo