[project @ 2004-02-04 10:51:18 by malcolm]
authormalcolm <unknown>
Wed, 4 Feb 2004 10:51:18 +0000 (10:51 +0000)
committermalcolm <unknown>
Wed, 4 Feb 2004 10:51:18 +0000 (10:51 +0000)
Exclude functions 'unfoldTreeM' and 'unfoldForestM' in nhc98.
For some unknown reason they result in a type inference error:
"No default for Prelude.Monad"

Data/Tree.hs

index 60c2548..d04fe3d 100644 (file)
@@ -20,7 +20,9 @@ module Data.Tree(
        flatten, levels,
        -- * Building trees
        unfoldTree, unfoldForest,
+#ifndef __NHC__
        unfoldTreeM, unfoldForestM,
+#endif
        unfoldTreeM_BF, unfoldForestM_BF,
     ) where
 
@@ -89,6 +91,7 @@ unfoldTree f b = let (a, bs) = f b in Node a (unfoldForest f bs)
 unfoldForest :: (b -> (a, [b])) -> [b] -> Forest a
 unfoldForest f = map (unfoldTree f)
 
+#ifndef __NHC__
 -- | Monadic tree builder, in depth-first order
 unfoldTreeM :: Monad m => (b -> m (a, [b])) -> b -> m (Tree a)
 unfoldTreeM f b = do
@@ -99,6 +102,7 @@ unfoldTreeM f b = do
 -- | Monadic forest builder, in depth-first order
 unfoldForestM :: Monad m => (b -> m (a, [b])) -> [b] -> m (Forest a)
 unfoldForestM f = mapM (unfoldTreeM f)
+#endif
 
 -- | Monadic tree builder, in breadth-first order,
 -- using an algorithm adapted from