module FRP.Rhine.ClSF.Random.Util where
import Control.Monad.Trans.Reader
import Control.Monad.Random
commuteReaderRand :: ReaderT r (RandT g m) a -> RandT g (ReaderT r m) a
commuteReaderRand :: forall r g (m :: Type -> Type) a.
ReaderT r (RandT g m) a -> RandT g (ReaderT r m) a
commuteReaderRand (ReaderT r -> RandT g m a
f) = forall g (m :: Type -> Type) a. (g -> m (a, g)) -> RandT g m a
liftRandT forall a b. (a -> b) -> a -> b
$ \g
g -> forall r (m :: Type -> Type) a. (r -> m a) -> ReaderT r m a
ReaderT forall a b. (a -> b) -> a -> b
$ \r
r -> forall g (m :: Type -> Type) a. RandT g m a -> g -> m (a, g)
runRandT (r -> RandT g m a
f r
r) g
g