git.iko.soy/typeable/timezone-olson
on master help sign in
In the monoid instance for OlsonData, shift the offsets of transIndex in right-hand argument.
commitd0e8acb62f3a4e4cbe3fb9c81d090d096686f81b authorYitzchak Gale <gale@sefer.org> dateWed 25 Aug 2010, 14:56 (16 years ago) parent83d58ad
1 file changed+5−2
Data/Time/LocalTime/TimeZone/Olson/Types.hs+5−2
Data/Time/LocalTime/TimeZone/Olson/Types.hs+5−2
@@ -65,8 +65,11 @@ data OlsonData =
6565
6666instance Monoid OlsonData where
6767 mempty = OlsonData [] [] [] Nothing
68− mappend (OlsonData a b c d ) (OlsonData a' b' c' d')
69− = OlsonData (a++a') (b++b') (c++c') (d `mplus` d')
68+ mappend (OlsonData a b c d ) (OlsonData a' b' c' d') =
69+ OlsonData (a ++ map (shiftBy $ length b) a')
70+ (b ++ b') (c ++ c') (d `mplus` d')
71+ where
72+ shiftBy n trans = trans {transIndex = n + transIndex trans}
7073
7174-- | A @Transition@ represents a moment when the clocks change in a
7275-- timezone. It consists of a Unix timestamp value that indicates the