gi-glib-2.0.12: GLib bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.Rand

Contents

Description

The GRand struct is an opaque data structure. It should only be accessed through the g_rand_* functions.

Synopsis

Exported types

newtype Rand #

Constructors

Rand (ManagedPtr Rand) 

Instances

WrappedPtr Rand # 
((~) * info (ResolveRandMethod t Rand), MethodInfo * info Rand p) => IsLabel t (Rand -> p) # 

Methods

fromLabel :: Proxy# Symbol t -> Rand -> p #

((~) * info (ResolveRandMethod t Rand), MethodInfo * info Rand p) => IsLabelProxy t (Rand -> p) # 

Methods

fromLabelProxy :: Proxy Symbol 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 # 

randDouble #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a 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 # 

randDoubleRange #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a Rand

-> Double

begin: lower closed bound of the interval

-> Double

end: upper open bound of the interval

-> 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 # 

randFree #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a Rand

-> m () 

Frees the memory allocated for the Rand.

int

data RandIntMethodInfo #

Instances

((~) * signature (m Word32), MonadIO m) => MethodInfo * RandIntMethodInfo Rand signature # 

randInt #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a 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 # 

randIntRange #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a Rand

-> Int32

begin: lower closed bound of the interval

-> Int32

end: upper open bound of the interval

-> 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 # 

randSetSeed #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a Rand

-> Word32

seed: a value to reinitialize the random number generator

-> 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 # 

randSetSeedArray #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rand

rand_: a Rand

-> Word32

seed: array to initialize with

-> Word32

seedLength: length of array

-> 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