Safe Haskell | None |
---|---|
Language | Haskell2010 |
A carrier for Control.Effect.Random.Random
implemented using RandomGen
.
Since: 1.1
Synopsis
- runRandom :: Applicative m => g -> RandomC g m a -> m (g, a)
- evalRandom :: Applicative m => g -> RandomC g m a -> m a
- execRandom :: Applicative m => g -> RandomC g m a -> m g
- evalRandomSystem :: MonadIO m => RandomC StdGen m a -> m a
- newtype RandomC g (m :: Type -> Type) a = RandomC (StateC g m a)
- module Control.Effect.Random
Random carrier
runRandom :: Applicative m => g -> RandomC g m a -> m (g, a) Source #
evalRandom :: Applicative m => g -> RandomC g m a -> m a Source #
Run a random computation starting from a given generator and discarding the final generator.
evalRandom
g (pure
b) =pure
b
Since: 1.0
execRandom :: Applicative m => g -> RandomC g m a -> m g Source #
Run a random computation starting from a given generator and discarding the final result.
execRandom
g (pure
b) = g
Since: 1.0
evalRandomSystem :: MonadIO m => RandomC StdGen m a -> m a Source #
Run a random computation in IO
, splitting the global standard generator to get a new one for the computation.
Since: 1.1
newtype RandomC g (m :: Type -> Type) a Source #
Instances
MonadTrans (RandomC g) Source # | |
Defined in Control.Carrier.Random.Gen | |
MonadIO m => MonadIO (RandomC g m) Source # | |
Defined in Control.Carrier.Random.Gen | |
Alternative m => Alternative (RandomC g m) Source # | |
Applicative (RandomC g m) Source # | |
Defined in Control.Carrier.Random.Gen | |
Functor (RandomC g m) Source # | |
Monad (RandomC g m) Source # | |
(Alternative m, Monad m) => MonadPlus (RandomC g m) Source # | |
MonadFail m => MonadFail (RandomC g m) Source # | |
Defined in Control.Carrier.Random.Gen | |
MonadFix m => MonadFix (RandomC g m) Source # | |
Defined in Control.Carrier.Random.Gen | |
(Algebra sig m, RandomGen g) => Algebra (Random :+: sig) (RandomC g m) Source # | |
Random effect
module Control.Effect.Random