Module

# Jack.Shrink

Package
purescript-jack
Repository
jystic/purescript-jack

### #shrinkTowardsSource

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

Shrink an integral by edging towards a destination number.

### #consNubSource

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

### #sequenceShrinkOneSource

``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).

### #sequenceShrinkListSource

``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.

### #sequenceShrinkSource

``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.

### #shrinkOneSource

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

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

### #shrinkListSource

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

Produce a smaller permutation of the input list.

### #halvesSource

``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]

### #removesSource

``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]]