Random123-0.1.2: Haskell port of Random123 library

Safe HaskellSafe-Inferred



Type synonyms and type classes for use in function and instance declarations.



type Array2 a = (a, a)Source

Type synonym for a 2-element array.

type Array4 a = (a, a, a, a)Source

Type synonym for a 4-element array.

class LimitedInteger a whereSource

Class of integers with more bits than in simple types yet having fixed limited size (unlike the built-in Integer).


liFromInteger :: Integer -> aSource

Creates an instance from an Integer (which is truncated by modulus 2^liBitSize).

liToInteger :: a -> IntegerSource

Creates an Integer in range [0, 2^liBitSize) from an instance.

liBitSize :: a -> IntSource

Returns the size of the information in the array.

class LimitedInteger a => Counter a whereSource

Class of CBRNG counters.


skip :: Integer -> a -> aSource

Skip ahead the given amount of steps.

increment :: a -> aSource

Increment the counter. Usually this function is faster than skip 1.


class Word32Array a whereSource

Class of objects allowing the extraction of 32-bit words from the given position.


getWord32 :: Int -> a -> Word32Source

Returns a Word32 from a position in range [0, numWords32 - 1).

numWords32 :: a -> IntSource

Number of 32-bit words in this array.

class Word64Array a whereSource

Class of objects allowing the extraction of 64-bit words from a given position.


getWord64 :: Int -> a -> Word64Source

Returns a Word64 from a position in range [0, numWords64 - 1).

numWords64 :: a -> IntSource

Number of 64-bit words in this array.