add final newlines
[ghc-hetmet.git] / compiler / utils / MonadUtils.hs
index 28613a4..4ddd4ea 100644 (file)
@@ -24,11 +24,6 @@ module MonadUtils
 -- Detection of available libraries
 ----------------------------------------------------------------------------------------
 
-#if __GLASGOW_HASKELL__ >= 606
-#define HAVE_APPLICATIVE 1
-#else
-#define HAVE_APPLICATIVE 0
-#endif
 -- we don't depend on MTL for now
 #define HAVE_MTL 0
 
@@ -38,9 +33,7 @@ module MonadUtils
 
 import Maybes
 
-#if HAVE_APPLICATIVE
 import Control.Applicative
-#endif
 #if HAVE_MTL
 import Control.Monad.Trans
 #endif
@@ -48,28 +41,6 @@ import Control.Monad
 import Control.Monad.Fix
 
 ----------------------------------------------------------------------------------------
--- Applicative
-----------------------------------------------------------------------------------------
-
-#if !HAVE_APPLICATIVE
-
-class Functor f => Applicative f where
-    pure  :: a -> f a
-    (<*>) :: f (a -> b) -> f a -> f b
-
-(<$>) :: Functor f => (a -> b) -> (f a -> f b)
-(<$>) = fmap
-
-infixl 4 <$>
-infixl 4 <*>
-
-instance Applicative IO where
-       pure = return
-       (<*>) = ap
-
-#endif
-
-----------------------------------------------------------------------------------------
 -- MTL
 ----------------------------------------------------------------------------------------
 
@@ -166,4 +137,4 @@ foldlM = foldM
 -- | Monadic version of foldr
 foldrM        :: (Monad m) => (b -> a -> m a) -> a -> [b] -> m a
 foldrM _ z []     = return z
-foldrM k z (x:xs) = do { r <- foldrM k z xs; k x r }
\ No newline at end of file
+foldrM k z (x:xs) = do { r <- foldrM k z xs; k x r }