X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FTree.hs;h=a7aab07c14265ab53d0572f6d45f014f9e6d0e0f;hb=b9b6e38a1ebb5f05b382609fe0776d91cdd1090b;hp=f2a55f59d28e32ef5ea75804fdc609aa12b4c4ac;hpb=30464c0cb915c2ae900909568fa8677bba341e45;p=haskell-directory.git diff --git a/Data/Tree.hs b/Data/Tree.hs index f2a55f5..a7aab07 100644 --- a/Data/Tree.hs +++ b/Data/Tree.hs @@ -93,7 +93,7 @@ draw (Node x ts0) = x : drawSubTrees ts0 -- | The elements of a tree in pre-order. flatten :: Tree a -> [a] flatten t = squish t [] - where squish (Node x ts) xs = x:foldr squish xs ts + where squish (Node x ts) xs = x:Prelude.foldr squish xs ts -- | Lists of nodes at each level of the tree. levels :: Tree a -> [[a]] @@ -120,7 +120,7 @@ unfoldTreeM f b = do #ifndef __NHC__ unfoldForestM :: Monad m => (b -> m (a, [b])) -> [b] -> m (Forest a) #endif -unfoldForestM f = mapM (unfoldTreeM f) +unfoldForestM f = Prelude.mapM (unfoldTreeM f) -- | Monadic tree builder, in breadth-first order, -- using an algorithm adapted from @@ -146,7 +146,7 @@ unfoldForestQ f aQ = case viewl aQ of EmptyL -> return empty a :< aQ -> do (b, as) <- f a - tQ <- unfoldForestQ f (foldl (|>) aQ as) + tQ <- unfoldForestQ f (Prelude.foldl (|>) aQ as) let (tQ', ts) = splitOnto [] as tQ return (Node b ts <| tQ') where splitOnto :: [a'] -> [b'] -> Seq a' -> (Seq a', [a'])