Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- genInitialTxOuts ∷ [Addr] → Gen [TxOut]
- genLovelace ∷ Gen Lovelace
- genTraverseSubsequence ∷ (a → Gen b) → [a] → Gen [b]
- genList ∷ Range Int → Gen a → Gen [a]
- interleaveTreeT ∷ Monad m ⇒ [TreeT m a] → m (NodeT m [a])
- genTxFromUTxO ∷ [Addr] → (Tx → Lovelace) → UTxO → Gen Tx
- propGenInputOutput ∷ Property
- genInputOutput ∷ [input] → (input → Integer) → Gen (Integer → output) → (output → Integer) → ((Integer → Integer) → output → output) → Gen ([input], [output])
- interleaveInputOutputTreeT ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (TreeT m [input], TreeT m [output]) → m (NodeT m ([input], [output]))
- interleaveInputOutput ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (NodeT m [input], NodeT m [output]) → NodeT m ([input], [output])
- shrinkRight ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (NodeT m [input], NodeT m [output]) → [TreeT m ([input], [output])]
- shrinkLeftPreserving ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (NodeT m [input], NodeT m [output]) → [TreeT m ([input], [output])]
- subFromList ∷ (Num n, Ord n) ⇒ n → (a → n) → ((n → n) → a → a) → [a] → [a]
- propGenSplitValue ∷ Property
- genSplitValue ∷ Integer → Gen (Integer → a) → (a → Integer) → ((Integer → Integer) → a → a) → Gen [a]
- interleaveTreeTPreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [TreeT m a] → m (NodeT m [a])
- interleavePreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [NodeT m a] → NodeT m [a]
- dropOnePreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [NodeT m a] → [TreeT m [a]]
- shrinkOnePreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [NodeT m a] → [TreeT m [a]]
- viewTwo ∷ [a] → [([a], a, a, [a])]
Documentation
genTraverseSubsequence ∷ (a → Gen b) → [a] → Gen [b] Source #
Generate a subsequence of a list of values and traverse the subsequence with a generator producer
interleaveTreeT ∷ Monad m ⇒ [TreeT m a] → m (NodeT m [a]) Source #
Temporarily defined here until hedgehog exposes this function
∷ [Addr] | List of addresses to choose from as recipients of the transaction outputs. |
→ (Tx → Lovelace) | Fee calculation |
→ UTxO | UTxO used to determine which unspent outputs can be used in the transaction. |
→ Gen Tx |
Generate a valid transaction from a given UTxO
propGenInputOutput ∷ Property Source #
A property to test that the entire shrink tree generated by
genInputOutput
maintains the invariant that the inputs and outputs have
equal sums
NB: This uses small values for the list and values, because we force the entire shrink tree, which can grow very large
∷ [input] | List of input to take a subsequence of |
→ (input → Integer) | A view of the value in the input used to preserve the invariant |
→ Gen (Integer → output) | A applicative generator for an output given a value |
→ (output → Integer) | A view of the value in the output used to preserve the invariant |
→ ((Integer → Integer) → output → output) | An update function for the output value used to preserve the invariant |
→ Gen ([input], [output]) |
Generate a subsequence of the inputs and split the value into a number of outputs
The shrink tree maintains the invariant that the sum of the inputs is equal to the sum of the outputs. This is generalised to any type of input where we can view the contained value, and type of output where we can generate the type from a value, and view and modify the contained value
interleaveInputOutputTreeT ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (TreeT m [input], TreeT m [output]) → m (NodeT m ([input], [output])) Source #
Used as part of genInputOutput
, so see there for details of the arguments
interleaveInputOutput ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (NodeT m [input], NodeT m [output]) → NodeT m ([input], [output]) Source #
Used as part of genInputOutput
, so see there for details of the arguments
shrinkRight ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (NodeT m [input], NodeT m [output]) → [TreeT m ([input], [output])] Source #
Used as part of genInputOutput
, so see there for details of the arguments
shrinkLeftPreserving ∷ Monad m ⇒ (input → Integer) → (output → Integer) → ((Integer → Integer) → output → output) → (NodeT m [input], NodeT m [output]) → [TreeT m ([input], [output])] Source #
Shrink the left value of a tuple, preserving the total value stored in the right value
Used as part of genInputOutput
, so see there for details of the arguments
∷ (Num n, Ord n) | |
⇒ n | The total value to remove from the list |
→ (a → n) | A view into the value contained in type |
→ ((n → n) → a → a) | A modifier for the value contained in type |
→ [a] | The list of |
→ [a] |
Remove total value from a list, removing from the front
propGenSplitValue ∷ Property Source #
A property to check that genSplitValue
does indeed preserve the input
∷ Integer | Total value to divide into outputs |
→ Gen (Integer → a) | Applicative generator for an output given a value |
→ (a → Integer) | A view of the value in the output used to preserve the invariant |
→ ((Integer → Integer) → a → a) | A modifier for the value in the output used to preserve the invariant |
→ Gen [a] |
Given an input value and functions to generate, view, and update some type
a
based on that value, split the input into a number of a
s, preserving
the value throughout the shrink tree
interleaveTreeTPreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [TreeT m a] → m (NodeT m [a]) Source #
Used as part of genSplitValue
, so see there for details of the arguments
interleavePreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [NodeT m a] → NodeT m [a] Source #
Used as part of genSplitValue
, so see there for details of the arguments
dropOnePreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [NodeT m a] → [TreeT m [a]] Source #
Drop one of the outputs, preserving the invariant by moving its value to the left
Used as part of genSplitValue
, so see there for details of the arguments
shrinkOnePreserving ∷ Monad m ⇒ (a → Integer) → ((Integer → Integer) → a → a) → [NodeT m a] → [TreeT m [a]] Source #
Shrink a value in a list, preserving the total value by moving the lost value to the left
Used as part of genSplitValue
, so see there for details of the arguments