HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulecardano-prelude-test-0.1.0.5Haskell2010

Test.Cardano.Prelude

  • 1 type
  • 2 classes
  • 56 values
valuerunGen :: Gen a -> a
#

Get something out of a quickcheck Gen without having to do IO

valuesublistN :: Int -> [a] -> Gen [a]
#

Choose a random (shuffled) subset of length n. Throws an error if there's not enough elements.

value(.=.) :: (Eq b, Show b) => (a -> b) -> (a -> b) -> a -> Property
#

Extensional equality combinator. Useful to express function properties as functional equations.

value(>=.) :: (Show (m b), Eq (m b)) => (a -> m b) -> (a -> m b) -> a -> Property
#

Monadic extensional equality combinator.

valuesumEquals :: Word64 -> Word64 -> Gen [Word64]
#

Generate list of arbitrary positive integers which sum equals given sum. All elements in the list will be smaller or equal then first parameter

classclass ArbitraryUnsafe a where
#

ArbitraryUnsafe class ~~~~~~~~~~~~~~~~~~~~~~~~

This class is the same as Arbitrary, except instances of this class for stuff like public/secret keys, VSS shares, commitments etc. are designed not to mimic real data as presisely as possible (using OpenSSL random), but rather to be simple and efficient.

This is especially useful for benchmarking.

Note: we don't need Generic to derive instances of ArbitraryUnsafe. We can either use one-line instance declaration, or -XStandaloneDeriving or -XDeriveAnyClass to write something like deriving (Arbitrary, ArbitraryUnsafe).

Methods

Instances7ArbitraryUnsafe, …