X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FFoldable.hs;h=096a3470c71b7f70fb03ad244494b339978cfcfe;hb=a2a70b9bf60672c72b35654105402cf21238b6f4;hp=1111a3747cfd57a9dd7488afe8a283dbefdc0269;hpb=19685800646d947586b0900b8ad63fed9d02e577;p=haskell-directory.git diff --git a/Data/Foldable.hs b/Data/Foldable.hs index 1111a37..096a347 100644 --- a/Data/Foldable.hs +++ b/Data/Foldable.hs @@ -65,6 +65,10 @@ import Data.Maybe (fromMaybe, listToMaybe) import Data.Monoid import Data.Array +#ifdef __NHC__ +import Control.Arrow (ArrowZero(..)) -- work around nhc98 typechecker problem +#endif + #ifdef __GLASGOW_HASKELL__ import GHC.Exts (build) #endif @@ -181,7 +185,7 @@ for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () {-# INLINE for_ #-} for_ = flip traverse_ --- | Map each element of a structure to an monadic action, evaluate +-- | Map each element of a structure to a monadic action, evaluate -- these actions from left to right, and ignore the results. mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ f = foldr ((>>) . f) (return ())