-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A file-packing application. -- -- Returns progressively better subsets of the specified files, selected -- to fit into a limited space, without wasting more than the specific -- ratio. @package squeeze @version 1.0.4.13 -- | module Squeeze.Data.File -- | A type suitable for containing an arbitrary set of file-paths. type FilePathList = [FilePath] -- | A type-synonym specifically to hold file-sizes (in bytes). type FileSize = Integer -- | A type suitable for containing a file-path, qualified by the -- corresponding FileSize. type FileSizeAndPath = (FileSize, FilePath) -- | accumulateSize :: [FileSizeAndPath] -> [FileSize] -- | Sum the FileSizes in the specified list. aggregateSize :: [FileSizeAndPath] -> FileSize -- | findDuplicates :: FilePathList -> IO FilePathList -- | Finds file-sizes. findSizes :: FilePathList -> IO [FileSizeAndPath] -- | Sorts a list of FileSizeAndPath by increasing size; ie. -- smallest first. orderByIncreasingSize :: [FileSizeAndPath] -> [FileSizeAndPath] -- | Sorts a list of FileSizeAndPath by decreasing size; ie. -- smallest first. orderByDecreasingSize :: [FileSizeAndPath] -> [FileSizeAndPath] -- | Acquire statistics related to a list of files. getFileSizeStatistics :: (Fractional mean, Floating standardDeviation) => [FileSizeAndPath] -> (Int, FileSize, mean, standardDeviation) -- | selectSuitableFileSizes :: (FileSize -> Bool) -> [FileSizeAndPath] -> Writer [String] [FileSizeAndPath] -- | Accessor. getSize :: FileSizeAndPath -> FileSize -- | Accessor. getPath :: FileSizeAndPath -> FilePath -- | True if the specified file has the required size according to the -- specified predicate. hasSizeBy :: (FileSize -> Bool) -> FileSizeAndPath -> Bool -- | module Squeeze.Data.FileCombination -- | Declare a list of files qualified by its aggregate size. data FileCombination -- | A constant empty instance. nullFileCombination :: FileCombination -- | Compares two file-combinations by their aggregate file-size. comparingAggregateFileSize :: FileCombination -> FileCombination -> Ordering -- | prepend :: FileSizeAndPath -> FileCombination -> FileCombination -- | Progressively raises the selection-criterion as each match is found, -- to produce monotonically increasing file-combinations. risingFilter :: FileSize -> [FileCombination] -> [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. risingMergeByAggregateFileSize :: [FileCombination] -> [FileCombination] -> [FileCombination] -- | Smart constructor. mkFileCombination :: FileSize -> FilePathList -> FileCombination -- | Construct a FileCombination from a single -- FileSizeAndPath. singleton :: FileSizeAndPath -> FileCombination -- | Predicate used to determine whether a specific file-combination -- matches a size-related requirement. hasSizeBy :: (FileSize -> Bool) -> FileCombination -> Bool instance GHC.Classes.Eq Squeeze.Data.FileCombination.FileCombination instance GHC.Show.Show Squeeze.Data.FileCombination.FileCombination instance ToolShed.SelfValidate.SelfValidator Squeeze.Data.FileCombination.FileCombination -- | -- -- module Squeeze.Data.CommandOptions -- | Declares a record to contain command-line options. data CommandOptions ratio -- | The bounds on the aggregate size of the set of files. solutionSizeBounds :: RealFrac f => CommandOptions f -> Interval FileSize -- | Derives the minimum number of bytes, from other options. deriveMinimumBytes :: RealFrac ratio => CommandOptions ratio -> FileSize -- | Reduce the requirements by the specified file-size. subtractFile :: RealFrac ratio => FileSize -> CommandOptions ratio -> CommandOptions ratio -- | Smart constructor. mkCommandOptions :: (Ord ratio, Real ratio) => Bool -> FileSize -> Maybe Int -> ratio -> Verbosity -> CommandOptions ratio instance GHC.Show.Show ratio => GHC.Show.Show (Squeeze.Data.CommandOptions.CommandOptions ratio) instance GHC.Classes.Eq ratio => GHC.Classes.Eq (Squeeze.Data.CommandOptions.CommandOptions ratio) instance GHC.Real.Fractional f => Data.Default.Class.Default (Squeeze.Data.CommandOptions.CommandOptions f) instance (GHC.Classes.Ord ratio, GHC.Real.Real ratio) => ToolShed.SelfValidate.SelfValidator (Squeeze.Data.CommandOptions.CommandOptions ratio) -- | -- -- Provides the capability to write two unevaluated lists to separate -- concurrent channels, read them both & merge the results into a -- single list, evaluating in parallel, lazily on demand. module Squeeze.Control.Concurrent.DivideAndConquer -- | Writes the two unevaluated lists to separate concurrent channels, -- lazily reads them both (resulting in parallel evaluation) & merges -- them into a single results-list. divideAndConquer :: ([a] -> [a] -> [a]) -> [a] -> [a] -> IO [a] -- | -- -- module Squeeze.Squeeze -- | findCombinations :: Interval FileSize -> [FileSizeAndPath] -> [FileCombination] -- | Orders the files by decreasing size, calls findCombinations, -- calls risingFilter to select progressively better solutions. findBestFit :: Interval FileSize -> [FileSizeAndPath] -> [FileCombination] -- | distributeAndFindBestFit :: RealFrac ratio => CommandOptions ratio -> [FileSizeAndPath] -> IO [FileCombination] -- | partitionEmptyFilesAndDistributeAndFindBestFit :: RealFrac ratio => CommandOptions ratio -> [FileSizeAndPath] -> IO [FileCombination]