qcheck/shrink

This module provides helpers for shrinking values.

You likely won’t be interacting with this module directly.

Many of these functions will likely become internal at some point.

Functions

pub fn atomic() -> fn(a) -> Iterator(a)

The atomic shrinker treats types as atomic, and never attempts to produce smaller values.

pub fn do_shrink(
  tree: Tree(a),
  property: fn(a) -> Bool,
  run_property_max_retries run_property_max_retries: Int,
  shrink_count shrink_count: Int,
) -> #(a, Int)
pub fn do_shrink_result(
  tree: Tree(a),
  property: fn(a) -> Result(b, c),
  run_property_max_retries run_property_max_retries: Int,
  shrink_count shrink_count: Int,
) -> #(a, Int)
pub fn float_towards(
  destination destination: Float,
) -> fn(Float) -> Iterator(Float)
pub fn float_towards_zero() -> fn(Float) -> Iterator(Float)
pub fn int_towards(
  destination destination: Int,
) -> fn(Int) -> Iterator(Int)
pub fn int_towards_zero() -> fn(Int) -> Iterator(Int)
pub fn shrink(
  tree: Tree(a),
  property: fn(a) -> Bool,
  run_property_max_retries run_property_max_retries: Int,
) -> #(a, Int)
pub fn shrink_result(
  tree: Tree(a),
  property: fn(a) -> Result(b, c),
  run_property_max_retries run_property_max_retries: Int,
) -> #(a, Int)
Search Document