Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- A data-type which references a set of files by their paths, and qualifies them with their aggregate size.
- data FileCombination
- nullFileCombination :: FileCombination
- comparingAggregateFileSize :: FileCombination -> FileCombination -> Ordering
- prepend :: FileSizeAndPath -> FileCombination -> FileCombination
- risingFilter :: FileSize -> [FileCombination] -> [FileCombination]
- risingMergeByAggregateFileSize :: [FileCombination] -> [FileCombination] -> [FileCombination]
- mkFileCombination :: FileSize -> FilePathList -> FileCombination
- singleton :: FileSizeAndPath -> FileCombination
- hasSizeBy :: (FileSize -> Bool) -> FileCombination -> Bool
Types
Data-types
data FileCombination Source #
Declare a list of files qualified by its aggregate size.
Constants
nullFileCombination :: FileCombination Source #
A constant empty instance.
Functions
comparingAggregateFileSize :: FileCombination -> FileCombination -> Ordering Source #
Compares two file-combinations by their aggregate file-size.
:: FileSizeAndPath | The new path to prepend to the incumbent file-combination. |
-> FileCombination | The incumbent combination of files. |
-> FileCombination |
- Prepend a
FileSizeAndPath
to an existingFileCombination
. - CAVEAT: performance hot-spot, so it by-passes the checks made by
mkFileCombination
.
:: FileSize | The initial minimum byte-size of file to accept. |
-> [FileCombination] | The input list of files to filter. |
-> [FileCombination] | The resulting list of files, which have met rising criterion. |
Progressively raises the selection-criterion as each match is found, to produce monotonically increasing file-combinations.
risingMergeByAggregateFileSize Source #
:: [FileCombination] | A list of monotonically increasing file-combinations. |
-> [FileCombination] | A list of monotonically increasing file-combinations. |
-> [FileCombination] |
Merges two lists of monotonically increasing lists of file-combinations, into a single monotonically increasing list, by dropping values which have a smaller aggregate size than results already found.
Constructors
mkFileCombination :: FileSize -> FilePathList -> FileCombination Source #
Smart constructor.
singleton :: FileSizeAndPath -> FileCombination Source #
Construct a FileCombination
from a single FileSizeAndPath
.