sampleOfLength ::
    (Gen a) ->
    Int ->
    IO [a]
sampleOfLength gen n =
    do
    rnd0 <- QCR.newQCGen
    return [(m r n) | (r,n) <- rnds rnd0 `zip` [0,2..2*n] ]
    where
    m = unGen gen
    rnds rnd = rnd1 : rnds rnd2 
        where (rnd1,rnd2) = R.split rnd

{-| Run the generator with size increased by 1 (useful for avoiding 
    too narrow selection at size 0 - in particular Double "randomly" generates 
    0 with probability 1 at size 0. 
-}
sampleOfLength ::
    (Gen a) ->
    Int ->
    IO [a]
sampleOfLength gen n =
    do
    rnd0 <- QCR.newQCGen
    return [(m r n) | (r,n) <- rnds rnd0 `zip` [0,2..2*n] ]
    where
    m = unGen gen
    rnds rnd = rnd1 : rnds rnd2 
        where (rnd1,rnd2) = R.split rnd

{-| Run the generator with size increased by 1 (useful for avoiding 
    too narrow selection at size 0 - in particular Double "randomly" generates 
    0 with probability 1 at size 0. 
-}
sampleOfLength gen n =
    do
    rnd0 <- QCR.newQCGen
    return [(m r n) | (r,n) <- rnds rnd0 `zip` [0,2..2*n] ]
    where
    m = unGen gen
    rnds rnd = rnd1 : rnds rnd2 
        where (rnd1,rnd2) = R.split rnd

{-| Run the generator with size increased by 1 (useful for avoiding 
    too narrow selection at size 0 - in particular Double "randomly" generates 
    0 with probability 1 at size 0. 
-}