monad-choice-0.2.0.0: Monad, monad transformer, and typeclass representing choices.

Copyright(c) Eamon Olive 2020
(c) Louis Hyde 2020
LicenseAGPL-3
Maintainerejolive97@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Choice.Random

Description

Module for UniformRandom, a wrapper that provides an instance of MonadChoice when it wraps a member of MonadRandom. This is done by using the uniform function as choose.

Synopsis

Documentation

newtype UniformRandom r a Source #

Constructors

UniformRandom (r a) 
Instances
MonadRWS r w s m => MonadRWS r w s (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

MonadSplit g m => MonadSplit g (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

getSplit :: UniformRandom m g #

MonadWriter w m => MonadWriter w (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

writer :: (a, w) -> UniformRandom m a #

tell :: w -> UniformRandom m () #

listen :: UniformRandom m a -> UniformRandom m (a, w) #

pass :: UniformRandom m (a, w -> w) -> UniformRandom m a #

MonadState s m => MonadState s (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

get :: UniformRandom m s #

put :: s -> UniformRandom m () #

state :: (s -> (a, s)) -> UniformRandom m a #

MonadReader r m => MonadReader r (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

ask :: UniformRandom m r #

local :: (r -> r) -> UniformRandom m a -> UniformRandom m a #

reader :: (r -> a) -> UniformRandom m a #

MonadError e m => MonadError e (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

throwError :: e -> UniformRandom m a #

catchError :: UniformRandom m a -> (e -> UniformRandom m a) -> UniformRandom m a #

(Foldable f, MonadRandom m) => MonadChoice f (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

choose :: f a -> UniformRandom m a Source #

Monad m => Monad (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

(>>=) :: UniformRandom m a -> (a -> UniformRandom m b) -> UniformRandom m b #

(>>) :: UniformRandom m a -> UniformRandom m b -> UniformRandom m b #

return :: a -> UniformRandom m a #

fail :: String -> UniformRandom m a #

Functor f => Functor (UniformRandom f) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

fmap :: (a -> b) -> UniformRandom f a -> UniformRandom f b #

(<$) :: a -> UniformRandom f b -> UniformRandom f a #

MonadFix m => MonadFix (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

mfix :: (a -> UniformRandom m a) -> UniformRandom m a #

MonadFail m => MonadFail (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

fail :: String -> UniformRandom m a #

Applicative f => Applicative (UniformRandom f) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

pure :: a -> UniformRandom f a #

(<*>) :: UniformRandom f (a -> b) -> UniformRandom f a -> UniformRandom f b #

liftA2 :: (a -> b -> c) -> UniformRandom f a -> UniformRandom f b -> UniformRandom f c #

(*>) :: UniformRandom f a -> UniformRandom f b -> UniformRandom f b #

(<*) :: UniformRandom f a -> UniformRandom f b -> UniformRandom f a #

Foldable f => Foldable (UniformRandom f) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

fold :: Monoid m => UniformRandom f m -> m #

foldMap :: Monoid m => (a -> m) -> UniformRandom f a -> m #

foldr :: (a -> b -> b) -> b -> UniformRandom f a -> b #

foldr' :: (a -> b -> b) -> b -> UniformRandom f a -> b #

foldl :: (b -> a -> b) -> b -> UniformRandom f a -> b #

foldl' :: (b -> a -> b) -> b -> UniformRandom f a -> b #

foldr1 :: (a -> a -> a) -> UniformRandom f a -> a #

foldl1 :: (a -> a -> a) -> UniformRandom f a -> a #

toList :: UniformRandom f a -> [a] #

null :: UniformRandom f a -> Bool #

length :: UniformRandom f a -> Int #

elem :: Eq a => a -> UniformRandom f a -> Bool #

maximum :: Ord a => UniformRandom f a -> a #

minimum :: Ord a => UniformRandom f a -> a #

sum :: Num a => UniformRandom f a -> a #

product :: Num a => UniformRandom f a -> a #

Traversable t => Traversable (UniformRandom t) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

traverse :: Applicative f => (a -> f b) -> UniformRandom t a -> f (UniformRandom t b) #

sequenceA :: Applicative f => UniformRandom t (f a) -> f (UniformRandom t a) #

mapM :: Monad m => (a -> m b) -> UniformRandom t a -> m (UniformRandom t b) #

sequence :: Monad m => UniformRandom t (m a) -> m (UniformRandom t a) #

MonadPlus m => MonadPlus (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

MonadIO m => MonadIO (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

liftIO :: IO a -> UniformRandom m a #

MonadRandom m => MonadRandom (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

getRandomR :: Random a => (a, a) -> UniformRandom m a #

getRandom :: Random a => UniformRandom m a #

getRandomRs :: Random a => (a, a) -> UniformRandom m [a] #

getRandoms :: Random a => UniformRandom m [a] #

MonadInterleave m => MonadInterleave (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Eq1 f => Eq1 (UniformRandom f) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

liftEq :: (a -> b -> Bool) -> UniformRandom f a -> UniformRandom f b -> Bool #

Ord1 f => Ord1 (UniformRandom f) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

liftCompare :: (a -> b -> Ordering) -> UniformRandom f a -> UniformRandom f b -> Ordering #

MonadZip m => MonadZip (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

mzip :: UniformRandom m a -> UniformRandom m b -> UniformRandom m (a, b) #

mzipWith :: (a -> b -> c) -> UniformRandom m a -> UniformRandom m b -> UniformRandom m c #

munzip :: UniformRandom m (a, b) -> (UniformRandom m a, UniformRandom m b) #

Alternative f => Alternative (UniformRandom f) Source # 
Instance details

Defined in Control.Monad.Choice.Random

MonadCont m => MonadCont (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

callCC :: ((a -> UniformRandom m b) -> UniformRandom m a) -> UniformRandom m a #

PrimMonad m => PrimMonad (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Associated Types

type PrimState (UniformRandom m) :: Type #

Eq (r a) => Eq (UniformRandom r a) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Methods

(==) :: UniformRandom r a -> UniformRandom r a -> Bool #

(/=) :: UniformRandom r a -> UniformRandom r a -> Bool #

Ord (r a) => Ord (UniformRandom r a) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Semigroup (r a) => Semigroup (UniformRandom r a) Source # 
Instance details

Defined in Control.Monad.Choice.Random

Monoid (r a) => Monoid (UniformRandom r a) Source # 
Instance details

Defined in Control.Monad.Choice.Random

type PrimState (UniformRandom m) Source # 
Instance details

Defined in Control.Monad.Choice.Random

lift :: r a -> UniformRandom r a Source #

An alias for UniformRandom

colift :: UniformRandom r a -> r a Source #

A function to unwrap a UniformRandom