select01 :: (Fractional b, RealFrac b) => [a] -> b -> a
select01 ls i = ls !! idx
  where
   lenlist = length ls
   idx = floor $ minmax 0.0 1.0 i * fromIntegral (lenlist - 1)

-- | Retrieve the packing extension fora  given loadspace, an
-- index package and its quantity, a single chromosome package and the current
-- list of residual spaces.
select01 :: (Fractional b, RealFrac b) => [a] -> b -> a
select01 ls i = ls !! idx
  where
   lenlist = length ls
   idx = floor $ minmax 0.0 1.0 i * fromIntegral (lenlist - 1)

-- | Retrieve the packing extension fora  given loadspace, an
-- index package and its quantity, a single chromosome package and the current
-- list of residual spaces.
select01 ls i = ls !! idx
  where
   lenlist = length ls
   idx = floor $ minmax 0.0 1.0 i * fromIntegral (lenlist - 1)

-- | Retrieve the packing extension fora  given loadspace, an
-- index package and its quantity, a single chromosome package and the current
-- list of residual spaces.