Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.GLib.Structs.Rand
Description
The GRand struct is an opaque data structure. It should only be accessed through the g_rand_* functions.
- newtype Rand = Rand (ManagedPtr Rand)
- noRand :: Maybe Rand
- data RandDoubleMethodInfo
- randDouble :: (HasCallStack, MonadIO m) => Rand -> m Double
- data RandDoubleRangeMethodInfo
- randDoubleRange :: (HasCallStack, MonadIO m) => Rand -> Double -> Double -> m Double
- data RandFreeMethodInfo
- randFree :: (HasCallStack, MonadIO m) => Rand -> m ()
- data RandIntMethodInfo
- randInt :: (HasCallStack, MonadIO m) => Rand -> m Word32
- data RandIntRangeMethodInfo
- randIntRange :: (HasCallStack, MonadIO m) => Rand -> Int32 -> Int32 -> m Int32
- data RandSetSeedMethodInfo
- randSetSeed :: (HasCallStack, MonadIO m) => Rand -> Word32 -> m ()
- data RandSetSeedArrayMethodInfo
- randSetSeedArray :: (HasCallStack, MonadIO m) => Rand -> Word32 -> Word32 -> m ()
Exported types
Constructors
Rand (ManagedPtr Rand) |
Instances
WrappedPtr Rand # | |
((~) * info (ResolveRandMethod t Rand), MethodInfo * info Rand p) => IsLabel t (Rand -> p) # | |
((~) * info (ResolveRandMethod t Rand), MethodInfo * info Rand p) => IsLabelProxy t (Rand -> p) # | |
HasAttributeList * Rand # | |
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m) => MethodInfo * RandSetSeedArrayMethodInfo Rand signature # | |
((~) * signature (Word32 -> m ()), MonadIO m) => MethodInfo * RandSetSeedMethodInfo Rand signature # | |
((~) * signature (Int32 -> Int32 -> m Int32), MonadIO m) => MethodInfo * RandIntRangeMethodInfo Rand signature # | |
((~) * signature (m Word32), MonadIO m) => MethodInfo * RandIntMethodInfo Rand signature # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * RandFreeMethodInfo Rand signature # | |
((~) * signature (Double -> Double -> m Double), MonadIO m) => MethodInfo * RandDoubleRangeMethodInfo Rand signature # | |
((~) * signature (m Double), MonadIO m) => MethodInfo * RandDoubleMethodInfo Rand signature # | |
type AttributeList Rand # | |
Methods
double
data RandDoubleMethodInfo #
Instances
((~) * signature (m Double), MonadIO m) => MethodInfo * RandDoubleMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> m Double | Returns: a random number |
Returns the next random gdouble
from rand_
equally distributed over
the range [0..1).
doubleRange
data RandDoubleRangeMethodInfo #
Instances
((~) * signature (Double -> Double -> m Double), MonadIO m) => MethodInfo * RandDoubleRangeMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> Double |
|
-> Double |
|
-> m Double | Returns: a random number |
Returns the next random gdouble
from rand_
equally distributed over
the range [begin
..end
).
free
data RandFreeMethodInfo #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * RandFreeMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> m () |
Frees the memory allocated for the Rand
.
int
data RandIntMethodInfo #
Instances
((~) * signature (m Word32), MonadIO m) => MethodInfo * RandIntMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> m Word32 | Returns: a random number |
Returns the next random guint32
from rand_
equally distributed over
the range [0..2^32-1].
intRange
data RandIntRangeMethodInfo #
Instances
((~) * signature (Int32 -> Int32 -> m Int32), MonadIO m) => MethodInfo * RandIntRangeMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> Int32 |
|
-> Int32 |
|
-> m Int32 | Returns: a random number |
Returns the next random gint32
from rand_
equally distributed over
the range [begin
..end
-1].
setSeed
data RandSetSeedMethodInfo #
Instances
((~) * signature (Word32 -> m ()), MonadIO m) => MethodInfo * RandSetSeedMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> Word32 |
|
-> m () |
Sets the seed for the random number generator Rand
to seed
.
setSeedArray
data RandSetSeedArrayMethodInfo #
Instances
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m) => MethodInfo * RandSetSeedArrayMethodInfo Rand signature # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> Rand |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Initializes the random number generator by an array of longs. Array can be of arbitrary size, though only the first 624 values are taken. This function is useful if you have many low entropy seeds, or if you require more then 32 bits of actual entropy for your application.
Since: 2.4