-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Comonadic interface for random values -- -- Comonadic interface for random values @package comonad-random @version 0.1.0 -- | This module provides a comonadic interface to random values. In some -- situations, this may be more natural than a monadic approach. module Control.Comonad.Random -- | A memoized supply of values data Rand a -- | Create a comonadic generator from a RandomGen. mkRand :: (RandomGen g, Random a) => g -> Rand a -- | Create a comonadic generator from a RandomGen where the values -- are limited to a given range. mkRandR :: (RandomGen g, Random a) => (a, a) -> g -> Rand a -- | Get the generator for the next value. next :: Rand a -> Rand a -- | Split the generator, returning the new left one. left :: Rand a -> Rand a -- | Split the generator, returning the new right one. right :: Rand a -> Rand a -- | Generate an infinite list of values by applying a function repeatedly. extracts :: (Rand a -> Rand a) -> Rand a -> [a] instance Functor Rand instance Copointed Rand instance Comonad Rand instance Applicative Rand instance Applicative Three instance Functor Three