From 88f0491c26432f4decf7cad2b3ad29dba1d5f5a6 Mon Sep 17 00:00:00 2001 From: malcolm Date: Wed, 4 Feb 2004 10:51:18 +0000 Subject: [PATCH] [project @ 2004-02-04 10:51:18 by malcolm] 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Data/Tree.hs b/Data/Tree.hs index 60c2548..d04fe3d 100644 --- a/Data/Tree.hs +++ b/Data/Tree.hs @@ -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 -- 1.7.10.4