[silver:util:random]
Contents of [silver:util:random]
:
Defined in this grammar:
Contained in grammar [silver:util:random]
. Defined at silver/util/random/RandomToken.sv line 6.
Monadic action to generate a RandomToken in the RandomGen Monad.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/RandomToken.sv line 11.
Utility attribute pair to thread a random token through an abstract syntax tree.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Util.sv line 9.
Parameterelems
The list to shuffle.
Return
A RandomGen monadic action to shuffle the list.
Randomly shuffle the elements of a list.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Util.sv line 26.
Parameterelems
The list from which to select an element.
Return
A RandomGen monadic action to select an element from the list.
Select a random element from a non-empty list. An error is raised when the list is empty.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Util.sv line 40.
Utility for creating a random value using the token-based random library.
Example:
production foo::RandomVal
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Util.sv line 48.
Create a random value using the default Random instance for the type.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Util.sv line 62.
Parametermin
The minimum bound for the random value.
Parametermax
The maximum bound for the random value.
Create a random value using the default RandomRange instance for the type.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Util.sv line 75.
Parameterg
The random generator to use to generate a value.
Create a random value using a monadic RandomGen action.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/RandomMonad.sv line 10.
Parameterr
The computation to run
ParameterioIn
The IO token
Return
An IOVal containing the result of the computation
Run a RandomGen computation, using an arbitrary seed.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/RandomMonad.sv line 23.
Parameterr
The computation to run
Run a RandomGen computation, using an arbitrary seed (IO monadic version.)
Contained in grammar [silver:util:random]
. Defined at silver/util/random/RandomMonad.sv line 38.
Parameterseed
The initial seed value for the random number generator
Parameterr
The computation to run
Return
The result of the computation
Run a RandomGen computation, using an arbitrary seed.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/RandomMonad.sv line 53.
Parametertoken
The random number generator to use
Parameterr
The computation to run
Return
The result of the computation
Run a RandomGen computation, using a random token.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Random.sv line 9.
Types for which random values can be generated.
This class imposes no restrictions on the range or distribution of random values, as there may be instances for types with no notion of ordering/equality.
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Random.sv line 41.
Types for which random values can be generated, uniformly distributed over some closed range [min, max].
Note that this is not a subclass of Ord since we may have instances for partial orders.
If a has an instance for Ord, then instances should satisfy: runRandomGen(randomRange(min, max)) >= min runRandomGen(randomRange(min, max)) <= max
Contained in grammar [silver:util:random]
. Defined at silver/util/random/Arbitrary.sv line 9.
Represents primitive (terminal) types for which arbitrary random values can be generated.