From 897ec7c12341f6f2b5f5b34cedf45907f061b2c1 Mon Sep 17 00:00:00 2001 From: malcolm Date: Wed, 4 Feb 2004 17:00:00 +0000 Subject: [PATCH] [project @ 2004-02-04 17:00:00 by malcolm] Excluding 'unfoldTreeM' and 'unfoldForestM' is overkill for nhc98. A simpler workaround for the type inference bug is just to omit one type signature from the mutually recursive pair. --- Data/Tree.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Data/Tree.hs b/Data/Tree.hs index d04fe3d..b9d2c54 100644 --- a/Data/Tree.hs +++ b/Data/Tree.hs @@ -20,9 +20,7 @@ module Data.Tree( flatten, levels, -- * Building trees unfoldTree, unfoldForest, -#ifndef __NHC__ unfoldTreeM, unfoldForestM, -#endif unfoldTreeM_BF, unfoldForestM_BF, ) where @@ -91,7 +89,6 @@ 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 @@ -100,9 +97,10 @@ unfoldTreeM f b = do return (Node a ts) -- | Monadic forest builder, in depth-first order +#ifndef __NHC__ unfoldForestM :: Monad m => (b -> m (a, [b])) -> [b] -> m (Forest a) -unfoldForestM f = mapM (unfoldTreeM f) #endif +unfoldForestM f = mapM (unfoldTreeM f) -- | Monadic tree builder, in breadth-first order, -- using an algorithm adapted from -- 1.7.10.4