diff options
Diffstat (limited to 'src/Data/Torrent/Tree.hs')
-rw-r--r-- | src/Data/Torrent/Tree.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Data/Torrent/Tree.hs b/src/Data/Torrent/Tree.hs index e9a337a1..8c18041a 100644 --- a/src/Data/Torrent/Tree.hs +++ b/src/Data/Torrent/Tree.hs | |||
@@ -15,8 +15,8 @@ module Data.Torrent.Tree | |||
15 | , Data.Torrent.Tree.lookup | 15 | , Data.Torrent.Tree.lookup |
16 | , lookupDir | 16 | , lookupDir |
17 | 17 | ||
18 | , fileCount | 18 | , fileNumber |
19 | , dirCount | 19 | , dirNumber |
20 | ) where | 20 | ) where |
21 | 21 | ||
22 | import Control.Arrow | 22 | import Control.Arrow |
@@ -62,10 +62,10 @@ lookupDir ps d | |||
62 | File _ -> Nothing | 62 | File _ -> Nothing |
63 | Dir es -> Just $ M.toList es | 63 | Dir es -> Just $ M.toList es |
64 | 64 | ||
65 | fileCount :: DirTree a -> Sum Int | 65 | fileNumber :: DirTree a -> Sum Int |
66 | fileCount File {..} = Sum 1 | 66 | fileNumber File {..} = Sum 1 |
67 | fileCount Dir {..} = foldMap fileCount children | 67 | fileNumber Dir {..} = foldMap fileNumber children |
68 | 68 | ||
69 | dirCount :: DirTree a -> Sum Int | 69 | dirNumber :: DirTree a -> Sum Int |
70 | dirCount File {..} = Sum 0 | 70 | dirNumber File {..} = Sum 0 |
71 | dirCount Dir {..} = Sum 1 <> foldMap dirCount children | 71 | dirNumber Dir {..} = Sum 1 <> foldMap dirNumber children |