jeudi 11 novembre 2021

Use Haskell's Control.Monad.Random.Class.fromList with System.Random

I want to use Control.Monad.Random.Class.fromList

fromList :: MonadRandom m => [(a, Rational)] -> m a

https://hackage.haskell.org/package/MonadRandom-0.5.3/docs/Control-Monad-Random-Class.html#v:fromList together with System.Random.mkStdGen

mkStdGen :: Int -> StdGen

https://hackage.haskell.org/package/random-1.2.1/docs/System-Random.html#v:mkStdGen

I see the instance

(Monad m, RandomGen g) => MonadInterleave (RandT g m)

but am not sure how to combine.




Aucun commentaire:

Enregistrer un commentaire