Community
Modules 3

System.Random.Internal

stable

This library deals with the common task of pseudo-random number generation.

Pure and monadic pseudo-random number generator interfaces

class RandomGen g

RandomGen is an interface to pure pseudo-random number generators.

StdGen is the standard RandomGen instance provided by this library.

next :: g -> (Int, g)

No longer used

Returns an Int that is uniformly distributed over the range returned by genRange (including both end points), and a new generator. Using next is inefficient as all operations go via Integer. See [here](https:/alexey.kuleshevi.chblog20191221random-benchmarks) for more details. It is thus deprecated.

genWord8 :: g -> (Word8, g)

Returns a Word8 that is uniformly distributed over the entire Word8 range.

genWord16 :: g -> (Word16, g)

Returns a Word16 that is uniformly distributed over the entire Word16 range.

genWord32 :: g -> (Word32, g)

Returns a Word32 that is uniformly distributed over the entire Word32 range.

genWord64 :: g -> (Word64, g)

Returns a Word64 that is uniformly distributed over the entire Word64 range.

genWord32R :: Word32 -> g -> (Word32, g)

genWord32R upperBound g returns a Word32 that is uniformly distributed over the range [0, upperBound].

genWord64R :: Word64 -> g -> (Word64, g)

genWord64R upperBound g returns a Word64 that is uniformly distributed over the range [0, upperBound].

genShortByteString :: Int -> g -> (ShortByteString, g)

In favor of `System.Random.uniformShortByteString`

Same as `uniformByteArray` `False`, but for `ShortByteString`.

genShortByteString n g returns a ShortByteString of length n filled with pseudo-random bytes.

Note - This function will be removed from the type class in the next major release as it is no longer needed because of `unsafeUniformFillMutableByteArray`.

unsafeUniformFillMutableByteArray :: MutableByteArray s -> Int -> Int -> g -> ST s g

Fill in the supplied `MutableByteArray` with uniformly generated random bytes. This function is unsafe because it is not required to do any bounds checking. For a safe variant use `System.Random.Sateful.uniformFillMutableByteArrayM` instead.

Default type class implementation uses `defaultUnsafeUniformFillMutableByteArray`.

Mutable array to fill with random bytes

Int

Offset into a mutable array from the beginning in number of bytes. Offset must be non-negative, but this will not be checked

Int

Number of randomly generated bytes to write into the array. Number of bytes must be non-negative and less then the total size of the array, minus the offset. This also will be checked.

genRange :: g -> (Int, Int)

No longer used

Yields the range of values returned by next.

It is required that:

  • If (a, b) = genRange g, then a < b.

  • genRange must not examine its argument so the value it returns is determined only by the instance of RandomGen.

The default definition spans the full range of Int.

split :: g -> (g, g)

In favor of `splitGen`

Returns two distinct pseudo-random number generators.

Implementations should take care to ensure that the resulting generators are not correlated. Some pseudo-random number generators are not splittable. In that case, the split implementation should fail with a descriptive error message.

class RandomGen g => SplitGen g

Pseudo-random generators that can be split into two separate and independent psuedo-random generators should provide an instance for this type class.

Historically this functionality was included in the `RandomGen` type class in the `split` function, however, few pseudo-random generators possess this property of splittability. This lead the old `split` function being usually implemented in terms of `error`.

splitGen :: g -> (g, g)

Returns two distinct pseudo-random number generators.

Implementations should take care to ensure that the resulting generators are not correlated.

newtype Seed g

This is a binary form of pseudo-random number generator's state. It is designed to be safe and easy to use for input/output operations like restoring from file, transmitting over the network, etc.

Constructor is not exported, becasue it is important for implementation to enforce the invariant of the underlying byte array being of the exact same length as the generator has specified in `System.Random.Seed.SeedSize`. Use `System.Random.Seed.mkSeed` and `System.Random.Seed.unSeed` to get access to the raw bytes in a safe manner.

Seed :: ByteArray -> Seed g

Stateful

class Monad m => StatefulGen g m

StatefulGen is an interface to monadic pseudo-random number generators.

uniformWord32R :: Word32 -> g -> m Word32

uniformWord32R upperBound g generates a Word32 that is uniformly distributed over the range [0, upperBound].

uniformWord64R :: Word64 -> g -> m Word64

uniformWord64R upperBound g generates a Word64 that is uniformly distributed over the range [0, upperBound].

uniformWord8 :: g -> m Word8

Generates a Word8 that is uniformly distributed over the entire Word8 range.

The default implementation extracts a Word8 from uniformWord32.

uniformWord16 :: g -> m Word16

Generates a Word16 that is uniformly distributed over the entire Word16 range.

The default implementation extracts a Word16 from uniformWord32.

uniformWord32 :: g -> m Word32

Generates a Word32 that is uniformly distributed over the entire Word32 range.

The default implementation extracts a Word32 from uniformWord64.

uniformWord64 :: g -> m Word64

Generates a Word64 that is uniformly distributed over the entire Word64 range.

The default implementation combines two Word32 from uniformWord32 into one Word64.

uniformByteArrayM :: Bool -> Int -> g -> m ByteArray

uniformByteArrayM n g generates a ByteArray of length n filled with pseudo-random bytes.

Bool

Should `ByteArray` be allocated as pinned memory or not

Int

Size of the newly created `ByteArray` in number of bytes.

g

Generator to use for filling in the newly created `ByteArray`

uniformShortByteString :: Int -> g -> m ShortByteString

In favor of `uniformShortByteStringM`

uniformShortByteString n g generates a ShortByteString of length n filled with pseudo-random bytes.

class StatefulGen (MutableGen f m) m => FrozenGen f m

This class is designed for mutable pseudo-random number generators that have a frozen imutable counterpart that can be manipulated in pure code.

It also works great with frozen generators that are based on pure generators that have a `RandomGen` instance.

Here are a few laws, which are important for this type class:

  • Roundtrip and complete destruction on overwrite:

overwriteGen mg fg >> freezeGen mg = pure fg
  • Modification of a mutable generator:

overwriteGen mg fg = modifyGen mg (const ((), fg)
  • Freezing of a mutable generator:

freezeGen mg = modifyGen mg (\fg -> (fg, fg))

MutableGen :: MutableGen f m = (g :: Type) | g -> f

Represents the state of the pseudo-random number generator for use with thawGen and freezeGen.

freezeGen :: MutableGen f m -> m f

Saves the state of the pseudo-random number generator as a frozen seed.

modifyGen :: MutableGen f m -> (f -> (a, f)) -> m a

Apply a pure function to the frozen pseudo-random number generator.

overwriteGen :: MutableGen f m -> f -> m ()

Overwrite contents of the mutable pseudo-random number generator with the supplied frozen one

class FrozenGen f m => ThawedGen f m

Functionality for thawing frozen generators is not part of the `FrozenGen` class, becase not all mutable generators support functionality of creating new mutable generators, which is what thawing is in its essence. For this reason `StateGen` does not have an instance for this type class, but it has one for `FrozenGen`.

Here is an important law that relates this type class to `FrozenGen`

  • Roundtrip and independence of mutable generators:

traverse thawGen fgs >>= traverse freezeGen = pure fgs

thawGen :: f -> m (MutableGen f m)

Create a new mutable pseudo-random number generator from its frozen state.

splitGenM :: (SplitGen f, FrozenGen f m) => MutableGen f m -> m f

Splits a pseudo-random number generator into two. Overwrites the mutable pseudo-random number generator with one of the immutable pseudo-random number generators produced by a `split` function and returns the other.

splitMutableGenM :: (SplitGen f, ThawedGen f m) => MutableGen f m -> m (MutableGen f m)

Splits a pseudo-random number generator into two. Overwrites the mutable wrapper with one of the resulting generators and returns the other as a new mutable generator.

Standard pseudo-random number generator

newtype StdGen

The standard pseudo-random number generator.

mkStdGen :: Int -> StdGen

Constructs a StdGen deterministically from an `Int` seed. See `mkStdGen64` for a `Word64` variant that is architecture agnostic.

mkStdGen64 :: Word64 -> StdGen

Constructs a StdGen deterministically from a `Word64` seed.

The difference between `mkStdGen` is that `mkStdGen64` will work the same on 64-bit and 32-bit architectures, while the former can only use 32-bit of information for initializing the psuedo-random number generator on 32-bit operating systems

theStdGen :: IORef StdGen

Global mutable veriable with `StdGen`

Monadic adapters for pure pseudo-random number generators

** Pure adapter

newtype StateGen g

Wrapper for pure state gen, which acts as an immutable seed for the corresponding stateful generator `StateGenM`

data StateGenM g

Opaque data type that carries the type of a pure pseudo-random number generator.

runStateGen :: RandomGen g => g -> (StateGenM g -> State g a) -> (a, g)

Runs a monadic generating action in the `State` monad using a pure pseudo-random number generator.

====Examples

>>> import System.Random.Stateful
>>> let pureGen = mkStdGen 137
>>> runStateGen pureGen randomM :: (Int, StdGen)
(7879794327570578227,StdGen {unStdGen = SMGen 11285859549637045894 7641485672361121627})

runStateGen_ :: RandomGen g => g -> (StateGenM g -> State g a) -> a

Runs a monadic generating action in the `State` monad using a pure pseudo-random number generator. Returns only the resulting pseudo-random value.

====Examples

>>> import System.Random.Stateful
>>> let pureGen = mkStdGen 137
>>> runStateGen_ pureGen randomM :: Int
7879794327570578227

runStateGenT :: RandomGen g => g -> (StateGenM g -> StateT g m a) -> m (a, g)

Runs a monadic generating action in the `StateT` monad using a pure pseudo-random number generator.

====Examples

>>> import System.Random.Stateful
>>> let pureGen = mkStdGen 137
>>> runStateGenT pureGen randomM :: IO (Int, StdGen)
(7879794327570578227,StdGen {unStdGen = SMGen 11285859549637045894 7641485672361121627})

runStateGenT_ :: (RandomGen g, Functor f) => g -> (StateGenM g -> StateT g f a) -> f a

Runs a monadic generating action in the `StateT` monad using a pure pseudo-random number generator. Returns only the resulting pseudo-random value.

====Examples

>>> import System.Random.Stateful
>>> let pureGen = mkStdGen 137
>>> runStateGenT_ pureGen randomM :: IO Int
7879794327570578227

runStateGenST :: RandomGen g => g -> (forall s. StateGenM g -> StateT g (ST s) a) -> (a, g)

Runs a monadic generating action in the `ST` monad using a pure pseudo-random number generator.

runStateGenST_ :: RandomGen g => g -> (forall s. StateGenM g -> StateT g (ST s) a) -> a

Runs a monadic generating action in the `ST` monad using a pure pseudo-random number generator. Same as `runStateGenST`, but discards the resulting generator.

Pseudo-random values of various types

class Uniform a

The class of types for which a uniformly distributed value can be drawn from all possible values of the type.

uniformM :: StatefulGen g m => g -> m a

Generates a value uniformly distributed over all possible values of that type.

There is a default implementation via Generic:

>>> :seti -XDeriveGeneric -XDeriveAnyClass
>>> import GHC.Generics (Generic)
>>> import System.Random.Stateful
>>> data MyBool = MyTrue | MyFalse deriving (Show, Generic, Finite, Uniform)
>>> data Action = Code MyBool | Eat (Maybe Bool) | Sleep deriving (Show, Generic, Finite, Uniform)
>>> gen <- newIOGenM (mkStdGen 42)
>>> uniformListM 10 gen :: IO [Action]
[Code MyTrue,Code MyTrue,Eat Nothing,Code MyFalse,Eat (Just False),Eat (Just True),Eat Nothing,Eat (Just False),Sleep,Code MyFalse]

uniformViaFiniteM :: (StatefulGen g m, Generic a, GFinite (Rep a)) => g -> m a

A definition of Uniform for Finite types. If your data has several fields of sub-Word cardinality, this instance may be more efficient than one, derived via Generic and GUniform.

>>> :seti -XDeriveGeneric -XDeriveAnyClass
>>> import GHC.Generics (Generic)
>>> import System.Random.Stateful
>>> data Triple = Triple Word8 Word8 Word8 deriving (Show, Generic, Finite)
>>> instance Uniform Triple where uniformM = uniformViaFiniteM
>>> gen <- newIOGenM (mkStdGen 42)
>>> uniformListM 5 gen :: IO [Triple]
[Triple 60 226 48,Triple 234 194 151,Triple 112 96 95,Triple 51 251 15,Triple 6 0 208]

class UniformRange a

The class of types for which a uniformly distributed value can be drawn from a range.

uniformRM :: StatefulGen g m => (a, a) -> g -> m a

Generates a value uniformly distributed over the provided range, which is interpreted as inclusive in the lower and upper bound.

  • uniformRM (1 :: Int, 4 :: Int) generates values uniformly from the set \{1,2,3,4\}

  • uniformRM (1 :: Float, 4 :: Float) generates values uniformly from the set \{x\;|\;1 \le x \le 4\}

The following law should hold to make the function always defined:

uniformRM (a, b) = uniformRM (b, a)

The range is understood as defined by means of isInRange, so

isInRange (a, b) <$> uniformRM (a, b) gen == pure True

but beware of [floating point number caveats](System-Random-Stateful.html#fpcaveats).

There is a default implementation via Generic:

>>> :seti -XDeriveGeneric -XDeriveAnyClass
>>> import GHC.Generics (Generic)
>>> import Data.Word (Word8)
>>> import Control.Monad (replicateM)
>>> import System.Random.Stateful
>>> gen <- newIOGenM (mkStdGen 42)
>>> data Tuple = Tuple Bool Word8 deriving (Show, Generic, UniformRange)
>>> replicateM 10 (uniformRM (Tuple False 100, Tuple True 150) gen)
[Tuple False 102,Tuple True 118,Tuple False 115,Tuple True 113,Tuple True 126,Tuple False 127,Tuple True 130,Tuple False 113,Tuple False 150,Tuple False 125]

isInRange :: (a, a) -> a -> Bool

A notion of (inclusive) ranges prescribed to a.

Ranges are symmetric:

isInRange (lo, hi) x == isInRange (hi, lo) x

Ranges include their endpoints:

isInRange (lo, hi) lo == True

When endpoints coincide, there is nothing else:

isInRange (x, x) y == x == y

Endpoints are endpoints:

isInRange (lo, hi) x ==>
isInRange (lo, x) hi == x == hi

Ranges are transitive relations:

isInRange (lo, hi) lo' && isInRange (lo, hi) hi' && isInRange (lo', hi') x
==> isInRange (lo, hi) x

There is a default implementation of isInRange via Generic. Other helper function that can be used for implementing this function are `isInRangeOrd` and `isInRangeEnum`.

Note that the isRange method from Data.Ix is not a suitable default implementation of isInRange. Unlike isInRange, isRange is not required to be symmetric, and many isRange implementations are not symmetric in practice.

uniformWordR :: StatefulGen g m => Word -> g -> m Word

Architecture specific `Word` generation in the specified lower range

Word

Maximum value to generate

g

Stateful generator

uniformDouble01M :: forall g m. StatefulGen g m => g -> m Double

Generates uniformly distributed Double in the range [0, 1]. Numbers are generated by generating uniform Word64 and dividing it by 2^{64}. It's used to implement UniformRange instance for Double.

uniformDoublePositive01M :: forall g m. StatefulGen g m => g -> m Double

Generates uniformly distributed Double in the range (0, 1]. Number is generated as 2^{-64}/2+\operatorname{uniformDouble01M}. Constant is 1/2 of smallest nonzero value which could be generated by uniformDouble01M.

uniformFloat01M :: forall g m. StatefulGen g m => g -> m Float

Generates uniformly distributed Float in the range [0, 1]. Numbers are generated by generating uniform Word32 and dividing it by 2^{32}. It's used to implement UniformRange instance for Float.

uniformFloatPositive01M :: forall g m. StatefulGen g m => g -> m Float

Generates uniformly distributed Float in the range (0, 1]. Number is generated as 2^{-32}/2+\operatorname{uniformFloat01M}. Constant is 1/2 of smallest nonzero value which could be generated by uniformFloat01M.

uniformEnumM :: forall a g m. (Enum a, Bounded a, StatefulGen g m) => g -> m a

Generates uniformly distributed Enum. One can use it to define a Uniform instance:

data Colors = Red | Green | Blue deriving (Enum, Bounded)
instance Uniform Colors where uniformM = uniformEnumM

uniformEnumRM :: forall a g m. (Enum a, StatefulGen g m) => (a, a) -> g -> m a

Generates uniformly distributed Enum in the given range. One can use it to define a UniformRange instance:

data Colors = Red | Green | Blue deriving (Enum)
instance UniformRange Colors where
  uniformRM = uniformEnumRM
  inInRange (lo, hi) x = isInRange (fromEnum lo, fromEnum hi) (fromEnum x)

uniformListM :: (StatefulGen g m, Uniform a) => Int -> g -> m [a]

Generates a list of pseudo-random values.

====Examples

>>> import System.Random.Stateful
>>> let pureGen = mkStdGen 137
>>> g <- newIOGenM pureGen
>>> uniformListM 10 g :: IO [Bool]
[True,True,True,True,False,True,True,False,False,False]

uniformListRM :: (StatefulGen g m, UniformRange a) => Int -> (a, a) -> g -> m [a]

Generates a list of pseudo-random values in a specified range.

====Examples

>>> import System.Random.Stateful
>>> let pureGen = mkStdGen 137
>>> g <- newIOGenM pureGen
>>> uniformListRM 10 (20, 30) g :: IO [Int]
[23,21,28,25,28,28,26,25,29,27]

isInRangeOrd :: Ord a => (a, a) -> a -> Bool

Utilize `Ord` instance to decide if a value is within the range. Designed to be used for implementing `isInRange`

isInRangeEnum :: Enum a => (a, a) -> a -> Bool

Utilize `Enum` instance to decide if a value is within the range. Designed to be used for implementing `isInRange`

scaleFloating :: forall a w. (RealFloat a, Integral w, Bounded w, FiniteBits w) => a -> a -> w -> a

This is the function that is used to scale a floating point value from random word range to the custom [low, high] range.

a

Low

a

High

w

Uniformly distributed unsigned integral value that will be used for converting to a floating point value and subsequent scaling to the specified range

Generators for sequences of pseudo-random bytes

uniformShortByteStringM :: StatefulGen g m => Int -> g -> m ShortByteString

uniformShortByteString n g generates a ShortByteString of length n filled with pseudo-random bytes.

uniformByteArray :: RandomGen g => Bool -> Int -> g -> (ByteArray, g)

Efficiently generates a sequence of pseudo-random bytes in a platform independent manner.

Bool

Should byte array be allocated in pinned or unpinned memory.

Int

Number of bytes to generate

g

Pure pseudo-random numer generator

fillByteArrayST :: Bool -> Int -> ST s Word64 -> ST s ByteArray

Using an `ST` action that generates 8 bytes at a time fill in a new `ByteArray` in architecture agnostic manner.

genShortByteStringIO :: Int -> IO Word64 -> IO ShortByteString

In favor of `fillByteArrayST`

Efficiently fills in a new `ShortByteString` in a platform independent manner.

IO action that can generate 8 random bytes at a time

Int

Number of bytes to generate

genShortByteStringST :: Int -> ST s Word64 -> ST s ShortByteString

In favor of `fillByteArrayST`, since `uniformShortByteString`, which it was used for, was also deprecated

Same as genShortByteStringIO, but runs in ST.

defaultUnsafeUniformFillMutableByteArray :: RandomGen g => MutableByteArray s -> Int -> Int -> g -> ST s g

Efficiently generates a sequence of pseudo-random bytes in a platform independent manner.

Int

Starting offset

Int

Number of random bytes to write into the array

g

ST action that can generate 8 random bytes at a time

Helpers for dealing with MutableByteArray

writeWord8 :: MutableByteArray s -> Int -> Word8 -> ST s ()

writeWord64LE :: MutableByteArray s -> Int -> Word64 -> ST s ()

Int

Offset into mutable byte array in number of bytes

Word64

8 bytes that will be written into the supplied array

indexWord8 :: ByteArray -> Int -> Word8

Int

Offset into immutable byte array in number of bytes

indexWord64LE :: ByteArray -> Int -> Word64

Int

Offset into immutable byte array in number of bytes

indexByteSliceWord64LE :: ByteArray -> Int -> Int -> Word64

Int

Starting offset in number of bytes

Int

Ending offset in number of bytes

Instances

116
  • instance Eq g => Eq (Seed g)
  • instance Ord g => Ord (Seed g)
  • instance Show g => Show (Seed g)
  • instance Eq g => Eq (StateGen g)
  • instance Ord g => Ord (StateGen g)
  • instance Show g => Show (StateGen g)
  • instance RandomGen g => RandomGen (StateGen g)
  • instance SplitGen g => SplitGen (StateGen g)
  • instance Storable g => Storable (StateGen g)
  • instance NFData g => NFData (StateGen g)
  • instance (RandomGen g, MonadState g m) => StatefulGen (StateGenM g) m
  • instance (RandomGen g, MonadState g m) => FrozenGen (StateGen g) m
  • instance Show StdGen
  • instance RandomGen StdGen
  • instance SplitGen StdGen
  • instance NFData StdGen
  • instance Eq StdGen
  • instance RandomGen SM.SMGen
  • instance SplitGen SM.SMGen
  • instance RandomGen SM32.SMGen
  • instance SplitGen SM32.SMGen
  • instance GUniform f => GUniform (M1 i c f)
  • instance Uniform a => GUniform (K1 i a)
  • instance GUniform U1
  • instance (GUniform f, GUniform g) => GUniform (f :*: g)
  • instance (GFinite f, GFinite g) => GUniform (f :+: g)
  • instance GUniformRange f => GUniformRange (M1 i c f)
  • instance UniformRange a => GUniformRange (K1 i a)
  • instance GUniformRange U1
  • instance (GUniformRange f, GUniformRange g) => GUniformRange (f :*: g)
  • instance UniformRange Integer
  • instance UniformRange Natural
  • instance Uniform Int8
  • instance UniformRange Int8
  • instance Uniform Int16
  • instance UniformRange Int16
  • instance Uniform Int32
  • instance UniformRange Int32
  • instance Uniform Int64
  • instance UniformRange Int64
  • instance Uniform Int
  • instance UniformRange Int
  • instance Uniform Word
  • instance UniformRange Word
  • instance Uniform Word8
  • instance UniformRange Word8
  • instance Uniform Word16
  • instance UniformRange Word16
  • instance Uniform Word32
  • instance UniformRange Word32
  • instance Uniform Word64
  • instance UniformRange Word64
  • instance Uniform CBool
  • instance UniformRange CBool
  • instance Uniform CChar
  • instance UniformRange CChar
  • instance Uniform CSChar
  • instance UniformRange CSChar
  • instance Uniform CUChar
  • instance UniformRange CUChar
  • instance Uniform CShort
  • instance UniformRange CShort
  • instance Uniform CUShort
  • instance UniformRange CUShort
  • instance Uniform CInt
  • instance UniformRange CInt
  • instance Uniform CUInt
  • instance UniformRange CUInt
  • instance Uniform CLong
  • instance UniformRange CLong
  • instance Uniform CULong
  • instance UniformRange CULong
  • instance Uniform CPtrdiff
  • instance UniformRange CPtrdiff
  • instance Uniform CSize
  • instance UniformRange CSize
  • instance Uniform CWchar
  • instance UniformRange CWchar
  • instance Uniform CSigAtomic
  • instance UniformRange CSigAtomic
  • instance Uniform CLLong
  • instance UniformRange CLLong
  • instance Uniform CULLong
  • instance UniformRange CULLong
  • instance Uniform CIntPtr
  • instance UniformRange CIntPtr
  • instance Uniform CUIntPtr
  • instance UniformRange CUIntPtr
  • instance Uniform CIntMax
  • instance UniformRange CIntMax
  • instance Uniform CUIntMax
  • instance UniformRange CUIntMax
  • instance UniformRange CFloat

    See [Floating point number caveats](System-Random-Stateful.html#fpcaveats).

  • instance UniformRange CDouble

    See [Floating point number caveats](System-Random-Stateful.html#fpcaveats).

  • instance Uniform Char
  • instance UniformRange Char
  • instance Uniform ()
  • instance UniformRange ()
  • instance Uniform Bool
  • instance UniformRange Bool
  • instance (Finite a, Uniform a) => Uniform (Maybe a)
  • instance (Finite a, Uniform a, Finite b, Uniform b) => Uniform (Either a b)
  • instance UniformRange Double

    See [Floating point number caveats](System-Random-Stateful.html#fpcaveats).

  • instance UniformRange Float

    See [Floating point number caveats](System-Random-Stateful.html#fpcaveats).

  • instance (Uniform a, Uniform b) => Uniform (a, b)
  • instance (Uniform a, Uniform b, Uniform c) => Uniform (a, b, c)
  • instance (Uniform a, Uniform b, Uniform c, Uniform d) => Uniform (a, b, c, d)
  • instance (Uniform a, Uniform b, Uniform c, Uniform d, Uniform e) => Uniform (a, b, c, d, e)
  • instance (Uniform a, Uniform b, Uniform c, Uniform d, Uniform e, Uniform f) => Uniform (a, b, c, d, e, f)
  • instance (Uniform a, Uniform b, Uniform c, Uniform d, Uniform e, Uniform f, Uniform g) => Uniform (a, b, c, d, e, f, g)
  • instance (UniformRange a, UniformRange b) => UniformRange (a, b)
  • instance (UniformRange a, UniformRange b, UniformRange c) => UniformRange (a, b, c)
  • instance (UniformRange a, UniformRange b, UniformRange c, UniformRange d) => UniformRange (a, b, c, d)
  • instance (UniformRange a, UniformRange b, UniformRange c, UniformRange d, UniformRange e) => UniformRange (a, b, c, d, e)
  • instance (UniformRange a, UniformRange b, UniformRange c, UniformRange d, UniformRange e, UniformRange f) => UniformRange (a, b, c, d, e, f)
  • instance (UniformRange a, UniformRange b, UniformRange c, UniformRange d, UniformRange e, UniformRange f, UniformRange g) => UniformRange (a, b, c, d, e, f, g)
Maintainer
libraries@haskell.org
Copyright
(c) The University of Glasgow 2001
License
BSD-style (see the file LICENSE in the 'random' repository)
Build record and source files

Community contribution. The service has not verified this documentation.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-858b1951-web-1

Metadata snapshot: 1012568133f474470681e07d72ee6260a4d8fe5ba2de42241172dfb36bf88370

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.