;=      !"#$%&'()*+,-./0123456789:;<  Safe-Inferred A Prompt; GADT describing a request for a primitive random variate. K Random variable definitions will request their entropy via these prompts, D and entropy sources will satisfy those requests. The functions in  Data.Random.Source.Internal.TH. extend incomplete entropy-source definitions 9 to complete ones, essentially defining a very flexible # implementation-defaulting system.  Some possible future additions:  PrimFloat :: Prim Float  PrimInt :: Prim Int 3 PrimPair :: Prim a -> Prim b -> Prim (a :*: b)  PrimNormal :: Prim Double ! PrimChoice :: [(Double :*: a)] -> Prim a * PrimBytes :: !Int -> Prim ByteString EUnfortunately, I cannot get Haddock to accept my comments about the N data constructors, but hopefully they should be reasonably self-explanatory.  =   =None%This type provides a way to define a  for a monad without actually  having to declare an instance. :A source of entropy which can be used in the given monad.  See also . .Minimum implementation is either the internal  or all + other functions. Additionally, this class's interface is subject to F extension at any time, so it is very, very strongly recommended that  the  randomSource6 Template Haskell function be used to implement this J function rather than directly implementing it. That function takes care K of choosing default implementations for any missing functions; as long as @ at least one function is implemented, it will derive sensible  implementations of all others. To use  randomSource6, just wrap your instance declaration as follows (and F enable the TemplateHaskell, MultiParamTypeClasses and GADTs language G extensions, as well as any others required by your instances, such as  FlexibleInstances):  $(randomSource [d| . instance RandomSource FooM Bar where 9 {- at least one RandomSource function... -}  |]) BGenerate a random value corresponding to the specified primitive. GThis is an internal interface; use at your own risk. It may change or  disappear at any time. (Generate a uniformly distributed random > (Generate a uniformly distributed random ? (Generate a uniformly distributed random @ (Generate a uniformly distributed random A (Generate a uniformly distributed random B in the range 0 <= U < 1 (Generate a uniformly distributed random C in the range 0 <= U < 256^n FA typeclass for monads with a chosen source of entropy. For example,  RVarD is such a monad - the source from which it is (eventually) sampled J is the only source from which a random variable is permitted to draw, so H when directly requesting entropy for a random variable these functions  are used. .Minimum implementation is either the internal  or all + other functions. Additionally, this class's interface is subject to F extension at any time, so it is very, very strongly recommended that  the  monadRandom6 Template Haskell function be used to implement this J function rather than directly implementing it. That function takes care K of choosing default implementations for any missing functions; as long as @ at least one function is implemented, it will derive sensible  implementations of all others. To use  monadRandom6, just wrap your instance declaration as follows (and < enable the TemplateHaskell and GADTs language extensions):  $(monadRandom [d| ) instance MonadRandom FooM where ) getRandomDouble = return pi ( getRandomWord16 = return 4  {- etc... -}  |]) BGenerate a random value corresponding to the specified primitive. GThis is an internal interface; use at your own risk. It may change or  disappear at any time. (Generate a uniformly distributed random > (Generate a uniformly distributed random ? (Generate a uniformly distributed random @ (Generate a uniformly distributed random A (Generate a uniformly distributed random B in the range 0 <= U < 1 !(Generate a uniformly distributed random C in the range 0 <= U < 256^n  !D  !   ! !DNone"A token representing the "standard" entropy source in a  P monad. Its sole purpose is to make the following true (when the types check): $ runRVar x StdRandom === sampleRVar "#E"#"#"#ENone(Given a mutable reference to a F generator, we can make a  = usable in any monad in which the reference can be modified. See Data.Random.Source.PureMT.getRandomPrimFromMTRef for more detailed J usage hints - this function serves exactly the same purpose except for a  $ generator instead of a PureMT generator. ) Similarly, !getRandomWordFromRandomGenState x can be used in any "state" ) monad in the mtl sense whose state is a F generator. 2 Additionally, the standard mtl state monads have  instances 9 which do precisely that, allowing an easy conversion of RVars and  other  Distribution instances to "pure" random variables.  Again, see Data.Random.Source.PureMT.getRandomPrimFromMTState for more N detailed usage hints - this function serves exactly the same purpose except  for a $ generator instead of a PureMT generator. '(G)HIJKL$%&'()$&%'() '(G)HIJKLNone *GBuild a word out of 2 bytes. No promises are made regarding the order > in which the bytes are stuffed. Note that this means that a  RandomSource  or  MonadRandom) making use of the default definition of  getRandomWord, etc., I may return different random values on different platforms when started . with the same seed, depending on the platform's endianness. +GBuild a word out of 4 bytes. No promises are made regarding the order > in which the bytes are stuffed. Note that this means that a  RandomSource  or  MonadRandom) making use of the default definition of  getRandomWord, etc., I may return different random values on different platforms when started . with the same seed, depending on the platform's endianness. -GBuild a word out of 8 bytes. No promises are made regarding the order > in which the bytes are stuffed. Note that this means that a  RandomSource  or  MonadRandom) making use of the default definition of  getRandomWord, etc., I may return different random values on different platforms when started . with the same seed, depending on the platform's endianness. 0Pack the low 23 bits from a @ into a M in the range [0,1).  Used to convert a  stdUniform @ to a  stdUniform B. 1ASame as word32ToFloat, but also return the unused bits (as the 9  least significant bits of a @) 2Pack the low 23 bits from a A into a M in the range [0,1).  Used to convert a  stdUniform A to a  stdUniform B. 3@Same as wordToFloat, but also return the unused bits (as the 41  least significant bits of a A) 4Pack the low 52 bits from a A into a B in the range [0,1).  Used to convert a  stdUniform A to a  stdUniform B. 5Pack a @ into a B( in the range [0,1). Note that a Double's 9 mantissa is 52 bits, so this does not fill all of them. 6ASame as wordToDouble, but also return the unused bits (as the 12  least significant bits of a A) *+,-./0123456 *+,-./0123456 *+,-./0123456 *+,-./0123456 None7Complete a possibly-incomplete  implementation. It is M recommended that this macro be used even if the implementation is currently  complete, as the $ class may be extended at any time. To use 76, just wrap your instance declaration as follows (and F enable the TemplateHaskell, MultiParamTypeClasses and GADTs language G extensions, as well as any others required by your instances, such as  FlexibleInstances):  $(randomSource [d| . instance RandomSource FooM Bar where 9 {- at least one RandomSource function... -}  |]) 8Complete a possibly-incomplete  implementation. It is M recommended that this macro be used even if the implementation is currently  complete, as the $ class may be extended at any time. To use 86, just wrap your instance declaration as follows (and < enable the TemplateHaskell and GADTs language extensions):  $(monadRandom [d| ) instance MonadRandom FooM where ) getRandomDouble = return pi ( getRandomWord16 = return 4  {- etc... -}  |]) *NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu7878 NQPORYXWVUTSZ[\]^_`abcdefghijklmnopqrstu78None9Given a mutable reference to a  generator, we can implement  = for it in any monad in which the reference can be modified. -Typically this would be used to define a new  instance for J some new reference type or new monad in which an existing reference type J can be modified atomically. As an example, the following instance could  be used to describe how v  can be a  in the  w monad:  / instance RandomSource IO (IORef PureMT) where # supportedPrimsFrom _ _ = True 9 getSupportedRandomPrimFrom = getRandomPrimFromMTRef F(note that there is actually a more general instance declared already , covering this as a a special case, so there's no need to repeat this  declaration anywhere) )Example usage (using some functions from  Data.Random in the random-fu  package):  main = do J src <- newIORef (pureMT 1234) -- OR: newPureMT >>= newIORef 3 x <- runRVar (uniform 0 100) src :: IO Double  print x xyz{|}9~99 xyz{|}9~None !78 !87NoneNone:On systems that have it, /dev/,random is a handy-dandy ready-to-use source B of nonsense. Keep in mind that on some systems, Linux included, /dev/random  collects "real" entropy, and if you don'$t have a good source of it, such as C special hardware for the purpose or a *lot* of network traffic, it's pretty easy M to suck the entropy pool dry with entropy-intensive applications. For many # purposes other than cryptography, /dev/&urandom is preferable because when it  runs out of real entropy it'&ll still churn out pseudorandom data. :;<:;<:<;:<; None        !""#$%&'()*+,-./012334564574589:;<=>?@ABCDEFGH I JKLML NOPQOPROPSOPT UVWXYZ[45\]^_`ab Uc d + # e f g h i j k l " m n o p q r s t u v w x y z { | } ~  O U_] random-source-0.3.0.6Data.Random.Source.MWCData.Random.Source.PureMTData.Random.Internal.SourceData.Random.Source.StdData.Random.Source.StdGenData.Random.Internal.WordsData.Random.SourceData.Random.Source.DevRandom Data.Random.Source.Internal.PrimData.Random.Source.Internal.THData.Random.Source.IOghc-primGHC.Prim RealWorldmersenne-random-pure64-0.2.0.3System.Random.Mersenne.Pure64 newPureMTpureMTPureMTmwc-random-0.13.1.0System.Random.MWCrestoresave initializecreateGenPrimPrimNByteInteger PrimDouble PrimWord64 PrimWord32 PrimWord16 PrimWord8GetPrim RandomSourcegetRandomPrimFromgetRandomWord8FromgetRandomWord16FromgetRandomWord32FromgetRandomWord64FromgetRandomDoubleFromgetRandomNByteIntegerFrom MonadRandom getRandomPrimgetRandomWord8getRandomWord16getRandomWord32getRandomWord64getRandomDoublegetRandomNByteInteger StdRandomrandom-1.0.1.1 System.RandomStdGen newStdGenmkStdGengetRandomPrimFromStdGenIOgetRandomPrimFromRandomGenRefgetRandomPrimFromRandomGenState buildWord16 buildWord32 buildWord32' buildWord64 buildWord64' buildWord64'' word32ToFloatword32ToFloatWithExcess wordToFloatwordToFloatWithExcess wordToDoubleword32ToDoublewordToDoubleWithExcess randomSource monadRandomgetRandomPrimFromMTRef DevRandom DevURandom $fShowPrimbaseGHC.WordWord8Word16Word32Word64 GHC.TypesDouble integer-gmpGHC.Integer.TypeInteger$fRandomSourcemGetPrim$fRandomSourcemStdRandom RandomGenatomicModifyReference'$fMonadRandomStateT$fMonadRandomStateT0$fRandomSourcemSTRef$fRandomSourcemIORef$fRandomSourcem1RefFloatContextGenericMethodGetNByteInteger GetDouble GetWord64 GetWord32 GetWord16GetWord8 allMethodsmethodNameBase methodName isMethodName nameToMethodscoreBymethod requireMethodimplementationscorecost dependsOninlinenoinlinereplaceMethodName changeContext specialize stripTypeSigs addSrcParamdummygetPrimgetWord8 getWord16 getWord32 getWord64 getDoublegetNByteIntegerdefaults GHC.IORefIORefIO withMTRef withMTState$fRandomSourcem1Ref0$fMonadRandomStateT2$fRandomSourcemIORef0$fRandomSourcemSTRef0$fRandomSourcemm0$fRandomSourcemm2$fRandomSourcemm4$fRandomSourcemm6$fRandomSourcemm8$fRandomSourceSTGen0$fRandomSourceIOGen0 devRandom devURandomdev$fRandomSourceIODevRandom0$fMonadRandomIO