Safe Haskell | Safe-Infered |
---|
- data Allocation
- allocation :: Int -> Allocation
- unAllocation :: Allocation -> Int
- allocate :: (Functor f, Foldable f, Traversable f) => f Allocation -> Int -> f Int
Documentation
data Allocation Source
Allocations are integers. The absolute value of the integer is
used, so for practical purposes -4
is the same allocation as 4
.
allocation :: Int -> AllocationSource
unAllocation :: Allocation -> IntSource
allocate :: (Functor f, Foldable f, Traversable f) => f Allocation -> Int -> f IntSource
Properties of the allocated result:
- If the sum of the absolute values of the allocations is zero, then each of the elements in the result will also be zero.
- Otherwise, if any allocation is zero, then the corresponding amount in the result will also be zero. The sum of the results will equal the total requested.