make Control.Monad.Instances compilable by nhc98
[haskell-directory.git] / Data / Tree.hs
index fec5856..f2a55f5 100644 (file)
@@ -28,7 +28,7 @@ module Data.Tree(
 import Prelude
 #endif
 
-import Control.Applicative (Applicative(..))
+import Control.Applicative (Applicative(..), (<$>))
 import Control.Monad
 import Data.Monoid (Monoid(..))
 import Data.Sequence (Seq, empty, singleton, (<|), (|>), fromList,
@@ -64,10 +64,7 @@ type Forest a = [Tree a]
 INSTANCE_TYPEABLE1(Tree,treeTc,"Tree")
 
 instance Functor Tree where
-  fmap = mapTree
-
-mapTree              :: (a -> b) -> (Tree a -> Tree b)
-mapTree f (Node x ts) = Node (f x) (map (mapTree f) ts)
+  fmap f (Node x ts) = Node (f x) (map (fmap f) ts)
 
 instance Traversable Tree where
   traverse f (Node x ts) = Node <$> f x <*> traverse (traverse f) ts