From c7dc14cd5106c9e3c5d481a09b6e6241f662e99d Mon Sep 17 00:00:00 2001 From: Ross Paterson Date: Sun, 17 Aug 2008 00:27:19 +0000 Subject: [PATCH] nhc only: expose Foldable and Traversable instances of Array These were turned off as a side-effect of a previous nhc-only fix for #2176 that is no longer needed. They should be fine for nhc now. --- Data/Foldable.hs | 6 +++--- Data/Traversable.hs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Data/Foldable.hs b/Data/Foldable.hs index 9d5502c..eaf0ab6 100644 --- a/Data/Foldable.hs +++ b/Data/Foldable.hs @@ -76,6 +76,8 @@ import GHC.Exts (build) import GHC.Arr #elif defined(__HUGS__) import Hugs.Array +#elif defined(__NHC__) +import Array #endif -- | Data structures that can be folded. @@ -153,10 +155,8 @@ instance Foldable [] where foldr1 = Prelude.foldr1 foldl1 = Prelude.foldl1 -#ifndef __NHC__ instance Ix i => Foldable (Array i) where - foldr f z = Prelude.foldr f z . elems -#endif + foldr f z = Prelude.foldr f z . elems -- | Fold over the elements of a structure, -- associating to the right, but strictly. diff --git a/Data/Traversable.hs b/Data/Traversable.hs index df10679..969e720 100644 --- a/Data/Traversable.hs +++ b/Data/Traversable.hs @@ -47,6 +47,8 @@ import Data.Monoid (Monoid) import GHC.Arr #elif defined(__HUGS__) import Hugs.Array +#elif defined(__NHC__) +import Array #endif -- | Functors representing data structures that can be traversed from @@ -110,10 +112,8 @@ instance Traversable [] where mapM = Prelude.mapM -#ifndef __NHC__ instance Ix i => Traversable (Array i) where - traverse f arr = listArray (bounds arr) `fmap` traverse f (elems arr) -#endif + traverse f arr = listArray (bounds arr) `fmap` traverse f (elems arr) -- general functions -- 1.7.10.4