- class Sampleable d m t where
- sample :: (Sampleable d m t, MonadRandom m) => d t -> m t
- sampleState :: (Sampleable d (State s) t, MonadRandom (State s)) => d t -> s -> (t, s)
- sampleStateT :: (Sampleable d (StateT s m) t, MonadRandom (StateT s m)) => d t -> s -> m (t, s)
A typeclass allowing
RVars to be sampled. Both may
also be sampled via
runRVarT, but I find it psychologically
pleasing to be able to sample both using this function, as they are two
separate abstractions for one base concept: a random variable.
Directly sample from a distribution or random variable, using the given source of entropy.
Sample a random variable using the default source of entropy for the monad in which the sampling occurs.
Sample a random variable in a "functional" style. Typical instantiations