
Excerpts from Daniel Schüssler's message of Sun Nov 15 07:51:35 +0100 2009:
Hi, Hi,
-- Invariant 1: There are never two adjacent Lefts or two adjacent Rights [...] normalize (Left a0 : Left a1 : as) = Left (mappend a0 a1) : normalize as normalize (Right a0 : Right a1 : as) = Right (mappend a0 a1) : normalize as
If you want to preserve your invariant, I think you should do : normalize (Left a0 : Left a1 : as) = normalize (Left (mappend a0 a1) : as) normalize (Right a0 : Right a1 : as) = normalize (Right (mappend a0 a1) : as) However, maybe it is correct if you only call normalize on (xs ++ ys) where xs and ys are already normalized so that you have only one point where you can break this invariant. Regards, -- Nicolas Pouillard http://nicolaspouillard.fr