falsify-0.4.0: Property-based testing with internal integrated shrinking
Safe HaskellNone
LanguageHaskell2010

Data.Falsify.Permutation

Description

Permutations

Intended for qualified import.

import Data.Falsify.Permutation (Permutation)
import qualified Data.Falsify.Permutation as Permutation
Synopsis

Documentation

data Permutation Source #

Permutation is a sequence of swaps

Instances

Instances details
Show Permutation Source # 
Instance details

Defined in Data.Falsify.Permutation

invariant :: Permutation -> Bool Source #

Permutation invariant

For every swap (i, j) in the permutation we must have i > j.

toSwaps :: Permutation -> [(Word, Word)] Source #

Individual swaps executed by this permutation

Construction

identity :: Permutation Source #

Identity permutation

fromSwaps :: [(Word, Word)] -> Permutation Source #

From swaps

Any identity swaps are filtered out.

Properties

size :: Permutation -> Int Source #

Number of swaps

Using permutations

apply :: Permutation -> [a] -> [a] Source #

Apply permutation