atlas-cardano-0.5.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.TxBuilder.Random

Description

 
Synopsis

Documentation

class Monad m ⇒ MonadRandom (m ∷ TypeType) where Source #

With a source of random number supply in hand, the MonadRandom class allows the programmer to extract random values of a variety of types.

Methods

getRandomRRandom a ⇒ (a, a) → m a Source #

Takes a range (lo,hi) and a random number generator g, and returns a computation that returns a random value uniformly distributed in the closed interval [lo,hi], together with a new generator. It is unspecified what happens if lo>hi. For continuous types there is no requirement that the values lo and hi are ever produced, but they may be, depending on the implementation and the interval.

See randomR for details.

getRandomRandom a ⇒ m a Source #

The same as getRandomR, but using a default range determined by the type:

  • For bounded types (instances of Bounded, such as Char), the range is normally the whole type.
  • For fractional types, the range is normally the semi-closed interval [0,1).
  • For Integer, the range is (arbitrarily) the range of Int.

See random for details.

getRandomRsRandom a ⇒ (a, a) → m [a] Source #

Plural variant of getRandomR, producing an infinite list of random values instead of returning a new generator.

See randomRs for details.

getRandomsRandom a ⇒ m [a] Source #

Plural variant of getRandom, producing an infinite list of random values instead of returning a new generator.

See randoms for details.

Instances

Instances details
MonadRandom GYTxMonadNode # 
Instance details

Defined in GeniusYield.TxBuilder.Node

Methods

getRandomRRandom a ⇒ (a, a) → GYTxMonadNode a Source #

getRandomRandom a ⇒ GYTxMonadNode a Source #

getRandomRsRandom a ⇒ (a, a) → GYTxMonadNode [a] Source #

getRandomsRandom a ⇒ GYTxMonadNode [a] Source #

MonadRandom GYTxMonadRun # 
Instance details

Defined in GeniusYield.TxBuilder.Run

Methods

getRandomRRandom a ⇒ (a, a) → GYTxMonadRun a Source #

getRandomRandom a ⇒ GYTxMonadRun a Source #

getRandomRsRandom a ⇒ (a, a) → GYTxMonadRun [a] Source #

getRandomsRandom a ⇒ GYTxMonadRun [a] Source #

MonadRandom NonRandom 
Instance details

Defined in Control.Monad.Random.NonRandom

Methods

getRandomRRandom a ⇒ (a, a) → NonRandom a Source #

getRandomRandom a ⇒ NonRandom a Source #

getRandomRsRandom a ⇒ (a, a) → NonRandom [a] Source #

getRandomsRandom a ⇒ NonRandom [a] Source #

MonadRandom IO 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → IO a Source #

getRandomRandom a ⇒ IO a Source #

getRandomRsRandom a ⇒ (a, a) → IO [a] Source #

getRandomsRandom a ⇒ IO [a] Source #

MonadRandom m ⇒ MonadRandom (MaybeT m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → MaybeT m a Source #

getRandomRandom a ⇒ MaybeT m a Source #

getRandomRsRandom a ⇒ (a, a) → MaybeT m [a] Source #

getRandomsRandom a ⇒ MaybeT m [a] Source #

(RandomGen g, Monad m) ⇒ MonadRandom (RandT g m) 
Instance details

Defined in Control.Monad.Trans.Random.Lazy

Methods

getRandomRRandom a ⇒ (a, a) → RandT g m a Source #

getRandomRandom a ⇒ RandT g m a Source #

getRandomRsRandom a ⇒ (a, a) → RandT g m [a] Source #

getRandomsRandom a ⇒ RandT g m [a] Source #

(RandomGen g, Monad m) ⇒ MonadRandom (RandT g m) 
Instance details

Defined in Control.Monad.Trans.Random.Strict

Methods

getRandomRRandom a ⇒ (a, a) → RandT g m a Source #

getRandomRandom a ⇒ RandT g m a Source #

getRandomRsRandom a ⇒ (a, a) → RandT g m [a] Source #

getRandomsRandom a ⇒ RandT g m [a] Source #

MonadRandom m ⇒ MonadRandom (ExceptT e m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → ExceptT e m a Source #

getRandomRandom a ⇒ ExceptT e m a Source #

getRandomRsRandom a ⇒ (a, a) → ExceptT e m [a] Source #

getRandomsRandom a ⇒ ExceptT e m [a] Source #

MonadRandom m ⇒ MonadRandom (IdentityT m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → IdentityT m a Source #

getRandomRandom a ⇒ IdentityT m a Source #

getRandomRsRandom a ⇒ (a, a) → IdentityT m [a] Source #

getRandomsRandom a ⇒ IdentityT m [a] Source #

MonadRandom m ⇒ MonadRandom (ReaderT r m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → ReaderT r m a Source #

getRandomRandom a ⇒ ReaderT r m a Source #

getRandomRsRandom a ⇒ (a, a) → ReaderT r m [a] Source #

getRandomsRandom a ⇒ ReaderT r m [a] Source #

MonadRandom m ⇒ MonadRandom (StateT s m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → StateT s m a Source #

getRandomRandom a ⇒ StateT s m a Source #

getRandomRsRandom a ⇒ (a, a) → StateT s m [a] Source #

getRandomsRandom a ⇒ StateT s m [a] Source #

MonadRandom m ⇒ MonadRandom (StateT s m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → StateT s m a Source #

getRandomRandom a ⇒ StateT s m a Source #

getRandomRsRandom a ⇒ (a, a) → StateT s m [a] Source #

getRandomsRandom a ⇒ StateT s m [a] Source #

(MonadRandom m, Monoid w) ⇒ MonadRandom (WriterT w m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → WriterT w m a Source #

getRandomRandom a ⇒ WriterT w m a Source #

getRandomRsRandom a ⇒ (a, a) → WriterT w m [a] Source #

getRandomsRandom a ⇒ WriterT w m [a] Source #

(MonadRandom m, Monoid w) ⇒ MonadRandom (WriterT w m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → WriterT w m a Source #

getRandomRandom a ⇒ WriterT w m a Source #

getRandomRsRandom a ⇒ (a, a) → WriterT w m [a] Source #

getRandomsRandom a ⇒ WriterT w m [a] Source #

MonadRandom m ⇒ MonadRandom (ContT r m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → ContT r m a Source #

getRandomRandom a ⇒ ContT r m a Source #

getRandomRsRandom a ⇒ (a, a) → ContT r m [a] Source #

getRandomsRandom a ⇒ ContT r m [a] Source #

(Monoid w, MonadRandom m) ⇒ MonadRandom (RWST r w s m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → RWST r w s m a Source #

getRandomRandom a ⇒ RWST r w s m a Source #

getRandomRsRandom a ⇒ (a, a) → RWST r w s m [a] Source #

getRandomsRandom a ⇒ RWST r w s m [a] Source #

(Monoid w, MonadRandom m) ⇒ MonadRandom (RWST r w s m) 
Instance details

Defined in Control.Monad.Random.Class

Methods

getRandomRRandom a ⇒ (a, a) → RWST r w s m a Source #

getRandomRandom a ⇒ RWST r w s m a Source #

getRandomRsRandom a ⇒ (a, a) → RWST r w s m [a] Source #

getRandomsRandom a ⇒ RWST r w s m [a] Source #

withRandomnessGYTxMonad m ⇒ (∀ n. (GYTxMonad n, MonadRandom n) ⇒ n a) → m a #

Convert a GYTxMonad-computation using randomness into a deterministic one by using one's own public key hash as seed for the random number generator.