Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal module: This module does not make any stability guarantees, and may not adhere to the PVP.
This module defines several utilities useful for shrinking demands and evaluations.
Of these, only axialShrinks
and fairInterleave
are used by StrictCheck;
nevertheless, we expose the DZipper
type and its associated functions in
this internal module just in case.
- newtype Shrink a = Shrink (a -> [a])
- axialShrinks :: SListI xs => NP Shrink xs -> NP I xs -> [[NP I xs]]
- fairInterleave :: [[a]] -> [a]
- data DZipper f whole where
- next :: DZipper f whole -> Maybe (DZipper f whole)
- positions :: NP f xs -> [DZipper f xs]
- dzipper :: NP f xs -> Maybe (DZipper f xs)
- dzip :: DZipper f xs -> NP f xs
Documentation
axialShrinks :: SListI xs => NP Shrink xs -> NP I xs -> [[NP I xs]] Source #
Given a list of shrinkers and a list of values-to-be-shrunk, generate a list of shrunken lists-of-values, each inner list being one potential "axis" for shrinking
That is, the first element of the result is all the ways the original product could be shrunken by only shrinking its first component, etc.
fairInterleave :: [[a]] -> [a] Source #
Fairly interleave a list of lists in a round-robin fashion
CPS-based zippers through heterogeneous products
data DZipper f whole where Source #
A DZipper
is a suspended traversal through a non-empty NP
n-ary product
The position of the traversal within that product is existentially quantified.
next :: DZipper f whole -> Maybe (DZipper f whole) Source #
Step one to the right in a DZipper
, returning Nothing
if this is not
possible
positions :: NP f xs -> [DZipper f xs] Source #
Given an n-ary product of xs
, get a list of DZipper
s, each focused in
sequence on the values of the input product
This is similar to the duplicate
operation on comonads.