main :: IO ()
main = defaultMain
  [ testProperty "sample equivalent to indexing" $
      forAll ((NE.:|) <$> arbitrary <*> arbitrary) $
      \ (xs :: NE.NonEmpty Int) i0 ->
        let n = length xs
            i = i0 `mod` n
        in  xs NE.!! i === collate (sample i id) xs
  , testProperty "bulkSample equivalent to indexing" $
      forAll ((NE.:|) <$> arbitrary <*> arbitrary) $
      \ (xs :: NE.NonEmpty Int) (is0 :: [Int]) ->
        let n = length xs
            is = map (`mod` n) is0
        in  map (xs NE.!!) is === collate (bulkSample is id) xs
  , testProperty "not quadratic" $
      collate (bulkSample (replicate 10000 999999) id) [0..1000000] ===
      replicate 10000 (999999 :: Integer)
  ]
main :: IO ()
main = defaultMain
  [ testProperty "sample equivalent to indexing" $
      forAll ((NE.:|) <$> arbitrary <*> arbitrary) $
      \ (xs :: NE.NonEmpty Int) i0 ->
        let n = length xs
            i = i0 `mod` n
        in  xs NE.!! i === collate (sample i id) xs
  , testProperty "bulkSample equivalent to indexing" $
      forAll ((NE.:|) <$> arbitrary <*> arbitrary) $
      \ (xs :: NE.NonEmpty Int) (is0 :: [Int]) ->
        let n = length xs
            is = map (`mod` n) is0
        in  map (xs NE.!!) is === collate (bulkSample is id) xs
  , testProperty "not quadratic" $
      collate (bulkSample (replicate 10000 999999) id) [0..1000000] ===
      replicate 10000 (999999 :: Integer)
  ]
main = defaultMain
  [ testProperty "sample equivalent to indexing" $
      forAll ((NE.:|) <$> arbitrary <*> arbitrary) $
      \ (xs :: NE.NonEmpty Int) i0 ->
        let n = length xs
            i = i0 `mod` n
        in  xs NE.!! i === collate (sample i id) xs
  , testProperty "bulkSample equivalent to indexing" $
      forAll ((NE.:|) <$> arbitrary <*> arbitrary) $
      \ (xs :: NE.NonEmpty Int) (is0 :: [Int]) ->
        let n = length xs
            is = map (`mod` n) is0
        in  map (xs NE.!!) is === collate (bulkSample is id) xs
  , testProperty "not quadratic" $
      collate (bulkSample (replicate 10000 999999) id) [0..1000000] ===
      replicate 10000 (999999 :: Integer)
  ]