Bodigrim/smallcheck

Port some convenience list functions from QuickCheck

rpglover64 opened this issue · 2 comments

I have a function which takes a list as an argument, and I would like to test that its result does not depend on the order of the list (sort comes to mind as a realistic example). QuickCheck has a function to do this: shuffle.

I have thrown together a simple implementation for SmallCheck here.

This is unnecessarily complicated. There's Data.List.permutations.

Just permutations lacks the (somewhat desirable) property that the number of permutations considered varies with Depth; that said, I guess either (\x -> generate (flip take x)) . permutations or (\x -> generate (flip take x . (2^)) . permutations would work.