diff options
author | tv <tv@krebsco.de> | 2017-04-30 13:52:13 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-04-30 15:46:31 +0200 |
commit | 1533765767e49f3db0d8e4b709de94e6db9fa596 (patch) | |
tree | a14b89eaa13d3a7c64d7981e8d4b56fbfc894361 | |
parent | c13d585d103ed0156386803b70dacb7b3b9a21b1 (diff) |
unloadPartsWithFilename: simplify use of f
-rw-r--r-- | TreeView.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/TreeView.hs b/TreeView.hs index dff50e8..02cab58 100644 --- a/TreeView.hs +++ b/TreeView.hs @@ -206,7 +206,7 @@ unloadReadSubForests t = case rootLabel t of unloadPartsWithFilename :: Forest TreeView -> Forest TreeView unloadPartsWithFilename = - map (rewriteTree f) + map rewriteTree where f x@Node{..} = case rootLabel of TVMessagePart _ mp -> @@ -216,10 +216,9 @@ unloadPartsWithFilename = x { subForest = [] } _ -> x - rewriteTree :: (Tree a -> Tree a) -> Tree a -> Tree a - rewriteTree f x = + rewriteTree x = let x' = f x - in x' { subForest = map (rewriteTree f) $ subForest x' } + in x' { subForest = map rewriteTree $ subForest x' } findFirsts :: (a -> Bool) -> Forest a -> Forest a |