Random123-0.2.0: Haskell port of Random123 library

Safe HaskellSafe-Inferred
LanguageHaskell98

System.Random.Random123.Types

Description

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

Synopsis

Documentation

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

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

Methods

liFromInteger :: Integer -> a Source

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

liToInteger :: a -> Integer Source

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

liBitSize :: a -> Int Source

Returns the size of the information in the array.

class LimitedInteger a => Counter a where Source

Class of CBRNG counters.

Minimal complete definition

Nothing

Methods

skip :: Integer -> a -> a Source

Skip ahead the given amount of steps.

increment :: a -> a Source

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

Instances

class Word32Array a where Source

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

Methods

getWord32 :: Int -> a -> Word32 Source

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

numWords32 :: a -> Int Source

Number of 32-bit words in this array.

class Word64Array a where Source

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

Methods

getWord64 :: Int -> a -> Word64 Source

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

numWords64 :: a -> Int Source

Number of 64-bit words in this array.