ZipList Monoid haskell
问题 The default monoid for lists in the GHC Prelude is concatenation. [1,2,3] <> [4,5,6] becomes [1,2,3] ++ [4,5,6] and thus [1,2,3,4,5,6] I want to write a ZipList Monoid instance that behaves like this: [ 1 <> 4 , 2 <> 5 , 3 <> 6 ] The result is [5,7,9] assuming I am using the sum monoid. Note this behaves like zipWith (+) Potentially it would behave like this: [ Sum 1 <> Sum 4 , Sum 2 <> Sum 5 , Sum 3 <> Sum 6 ] I need to create a newtype around the ZipList newtype and the Sum newtype in order