Safe Haskell | None |
---|---|

Language | Haskell2010 |

# Documentation

shuffle :: Monad m => GetRandR m -> [a] -> m [a] Source #

Reimplementation of `shuffleM`

in terms of a raw `Monad m => m a`

.
TODO: Generalize by mono-traversable

sampleOne :: (IsSequence seq, Monad m) => GetRandR m -> seq -> m (Maybe (Element seq)) Source #

Implementation of Reservoir sampling for a single sample.

sampleSplitOne :: (IsSequence seq, Monad m) => GetRandR m -> seq -> m (Maybe (Element seq, seq)) Source #

Implementation of Reservoir sampling
for a single sample. By contrast to `sampleOne`

,
this function returns not chosen elements in addition.