polysemy-0.1.2.1: Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone
LanguageHaskell2010

Polysemy.Random

Contents

Synopsis

Effect

data Random m a where Source #

An effect capable of providing Random values.

Constructors

Random :: Random x => Random m x 
RandomR :: Random x => (x, x) -> Random m x 
Instances
type DefiningModule (Random :: k -> Type -> Type) Source # 
Instance details

Defined in Polysemy.Random

type DefiningModule (Random :: k -> Type -> Type) = "Polysemy.Random"

Actions

random :: forall x. Random x => forall r. Member Random r => Sem r x Source #

randomR :: forall x. Random x => forall r. Member Random r => (x, x) -> Sem r x Source #

Interpretations

runRandom :: forall q r a. RandomGen q => q -> Sem (Random ': r) a -> Sem r (q, a) Source #

Run a Random effect with an explicit RandomGen.

runRandomIO :: Member (Lift IO) r => Sem (Random ': r) a -> Sem r a Source #

Run a Random effect by using the IO random generator.