MuCheck-0.3.0.4: Automated Mutation Testing

Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.MuCheck.Utils.Common

Description

Common functions used by MuCheck

Synopsis

Documentation

choose :: [a] -> Int -> [[a]] Source

The choose function generates subsets of a given size

coupling :: Eq a => (a -> a -> t) -> [a] -> [t] Source

The coupling function produces all possible pairings, and applies the given function to each

replaceFst :: Eq a => (a, a) -> [a] -> [a] Source

The replaceFst function replaces first matching element in a list given old and new values as a pair

sample :: RandomGen g => g -> Int -> [t] -> [t] Source

The sample function takes a random generator and chooses a random sample subset of given size.

rSample :: Int -> [t] -> IO [t] Source

Wrapper around sample providing the random seed

sampleF :: RandomGen g => g -> Rational -> [t] -> [t] Source

The sampleF function takes a random generator, and a fraction and returns subset of size given by fraction

remElt :: Int -> [a] -> [a] Source

The remElt function removes element at index specified from a list

swapElts :: Int -> Int -> [t] -> [t] Source

The swapElts function swaps two elements in a list given their indices

genSwapped :: [t] -> [[t]] Source

The genSwapped generates a list of lists where each element has been swapped by another

genRandomSeed :: IO StdGen Source

Generate a random seed from the time.

curryM :: (t1 -> t2 -> m t) -> (t1, t2) -> m t Source

take a function of two args producing a monadic result, and apply it to a pair

hash :: String -> String Source

A simple hash