Jump to content

File size distribution: Difference between revisions

m
Line 448:
frequencyGroups _ [] = newFrequencyGroups
frequencyGroups totalGroups xs
| length xs == 1 = Map.singleton (head xs, head xs) 1
| otherwise = foldr placeGroups newFrequencyGroups xs `using` parTraversable rseq
where
Line 479:
expand :: FrequencyGroups -> FrequencyGroups
expand = foldr f . withStrategy (parTraversable rseq) <*>
Map.mapWithKey groupsFromGroup . overThresholdMap.filter (> groupThreshold)
 
where
overThreshold = Map.filter (> groupThreshold)
 
f :: Maybe (FGKey, FrequencyGroups) -- ^ expanded frequency group
-> FrequencyGroups -- ^ accumulator
Line 498 ⟶ 496:
| otherwise = Nothing
where
collectBetween min maxrange = filter (\n -> n >= min && n <= max) fileSizes
range = collectBetween min max fileSizes
 
displaySize :: Integer -> String
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.