Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data QC = QC
- mkDummyHash ∷ ∀ h a b. (HashAlgorithm h, EncCBOR a) ⇒ a → Hash h b
- mkHashStdGen ∷ EncCBOR x ⇒ x → StdGen
Documentation
This is a pseudo random number generator used by QuickCheck and allows to use
random
's stateful interface to work dierctly in Gen
monad. This comes from an
unmerged QuickCheck PR: https://github.com/nick8325/quickcheck/pull/333
Instances
StatefulGen QC Gen Source # | |
Defined in Test.Cardano.Ledger.Binary.Random uniformWord32R ∷ Word32 → QC → Gen Word32 Source # uniformWord64R ∷ Word64 → QC → Gen Word64 Source # uniformWord8 ∷ QC → Gen Word8 Source # uniformWord16 ∷ QC → Gen Word16 Source # uniformWord32 ∷ QC → Gen Word32 Source # uniformWord64 ∷ QC → Gen Word64 Source # uniformShortByteString ∷ Int → QC → Gen ShortByteString Source # |
mkDummyHash ∷ ∀ h a b. (HashAlgorithm h, EncCBOR a) ⇒ a → Hash h b Source #
It is possible to use a hash of a binary representation of any type as a source of randomness, since hash value by its definiteion is uniformly distributed.