expand Foldable instance for Array
authorRoss Paterson <ross@soi.city.ac.uk>
Wed, 2 Jun 2010 21:21:54 +0000 (21:21 +0000)
committerRoss Paterson <ross@soi.city.ac.uk>
Wed, 2 Jun 2010 21:21:54 +0000 (21:21 +0000)
Data/Foldable.hs

index 9f7d3e9..c44f0cd 100644 (file)
@@ -162,6 +162,9 @@ instance Foldable [] where
 
 instance Ix i => Foldable (Array i) where
         foldr f z = Prelude.foldr f z . elems
+        foldl f z = Prelude.foldl f z . elems
+        foldr1 f = Prelude.foldr1 f . elems
+        foldl1 f = Prelude.foldl1 f . elems
 
 -- | Fold over the elements of a structure,
 -- associating to the right, but strictly.