module Crypto.Random.Probabilistic
( probabilistic
) where
import Crypto.Internal.Compat
import Crypto.Random.Types
import Crypto.Random
probabilistic :: MonadPseudoRandom ChaChaDRG a -> a
probabilistic :: forall a. MonadPseudoRandom ChaChaDRG a -> a
probabilistic MonadPseudoRandom ChaChaDRG a
f = (a, ChaChaDRG) -> a
forall a b. (a, b) -> a
fst ((a, ChaChaDRG) -> a) -> (a, ChaChaDRG) -> a
forall a b. (a -> b) -> a -> b
$ ChaChaDRG -> MonadPseudoRandom ChaChaDRG a -> (a, ChaChaDRG)
forall gen a. DRG gen => gen -> MonadPseudoRandom gen a -> (a, gen)
withDRG ChaChaDRG
drg MonadPseudoRandom ChaChaDRG a
f
where {-# NOINLINE drg #-}
drg :: ChaChaDRG
drg = IO ChaChaDRG -> ChaChaDRG
forall a. IO a -> a
unsafeDoIO IO ChaChaDRG
forall (randomly :: * -> *).
MonadRandom randomly =>
randomly ChaChaDRG
drgNew
{-# NOINLINE probabilistic #-}