Module

Jack.Shrink

Package
purescript-jack
Repository
jystic/purescript-jack

#shrinkTowards Source

shrinkTowards :: forall a. Ord a => EuclideanRing a => a -> a -> List a

Shrink an integral by edging towards a destination number.

#consNub Source

consNub :: forall a. Eq a => a -> List a -> List a

#sequenceShrinkOne Source

sequenceShrinkOne :: forall a. List (Tree a) -> Tree (List a)

Turn a list of trees in to a tree of lists, opting to shrink only the elements of the list (i.e. the size of the list will always be the same).

#sequenceShrinkList Source

sequenceShrinkList :: forall a. List (Tree a) -> Tree (List a)

Turn a list of trees in to a tree of lists, opting to shrink both the list itself and the elements in the list during traversal.

#sequenceShrink Source

sequenceShrink :: forall a. (List (Tree a) -> List (List (Tree a))) -> List (Tree a) -> Tree (List a)

Turn a list of trees in to a tree of lists, using the supplied function to merge shrinking options.

#shrinkOne Source

shrinkOne :: forall a. (a -> List a) -> List a -> List (List a)

Shrink each of the elements in input list using the supplied shrinking function.

#shrinkList Source

shrinkList :: forall a. List a -> List (List a)

Produce a smaller permutation of the input list.

#halves Source

halves :: forall a. Ord a => EuclideanRing a => a -> List a

Produces a list containing the results of halving a number over and over again.

halves 30 == [30,15,7,3,1] halves 128 == [128,64,32,16,8,4,2,1] halves (-10) == [-10,-5,-2,-1]

#removes Source

removes :: forall a. Int -> List a -> List (List a)

Permutes a list by removing 'k' consecutive elements from it:

removes 2 [1,2,3,4,5,6] == [[3,4,5,6],[1,2,5,6],[1,2,3,4]]