Closed flip111 closed 2 years ago
I am up to my eyeballs atm - if you can send a PR that would be great otherwise it will take me some time to looking at this.
I guess this is the code for ReaderT
import Data.Random.Internal.Source (getRandomPrimFrom)
import Data.Random.Source (randomSource)
$(randomSource [d|
instance RandomSource m s => RandomSource (ReaderT e m) s where
getRandomPrimFrom a b = lift (getRandomPrimFrom a b)
|])
Some questions:
RandomSource
has already quite some instances. I can't find these instances, where are they?I think this should do what you want: https://github.com/haskell-numerics/random-fu/pull/67. Let me know and we can close this. Thanks and sorry for taking so long.
I like to see
instance (MonadTrans t, Monad m) => RandomSource (t m) s
to be made available. So i can use ReaderT together with RandomSource. Right nowRandomSource IO (Gen RealWorld)
is available but when i try to useRandomSource (ReaderT Env IO) (Gen RealWorld)
it doesn't work.Doesn't work =
No instance for (RandomSource (ReaderT Env IO) (Gen RealWorld)) arising from a use of blabla