polysemy-zoo-0.8.1.0: Experimental, user-contributed effects and interpreters for polysemy
Safe HaskellNone
LanguageHaskell2010

Polysemy.Random

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 

Actions

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

randomR :: forall r x. (Member Random r, Random x) => (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 (Embed IO) r => Sem (Random ': r) a -> Sem r a Source #

Run a Random effect by using the IO random generator.