-- | Replicate all indexed packages with their quantities into a flat list.
-- Say package A is to be placed 3 times, package B twice. Then the resulting list will be:
-- [A, A, A, B, B]. The order of packages is defined by the order of the provided list of packages.
qutantityReplicateItems :: ItemSpaces -> ItemQuantities -> ItemSpaces
qutantityReplicateItems is =
  concatMap (\(key, quantity) -> replicate quantity $ is !! key)
qutantityReplicateItems :: ItemSpaces -> ItemQuantities -> ItemSpaces
qutantityReplicateItems is =
  concatMap (\(key, quantity) -> replicate quantity $ is !! key)
qutantityReplicateItems is =
  concatMap (\(key, quantity) -> replicate quantity $ is !! key)