Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current shrink strategy produces potentially quite a lot of duplication. By using a binary search, we should be able to significantly speed up shrinking. With this change we can see ``` Gen.printTreeWith 30 (Seed 5 3) $ Gen.int (Range.constant 0 22) 7 ├╼ 0 ├╼ 4 │ ├╼ 2 │ │ └╼ 1 │ └╼ 3 └╼ 6 └╼ 5 ``` While before we had ``` Gen.printTreeWith 30 (Seed 5 3) $ Gen.int (Range.constant 0 22) 7 ├╼ 0 ├╼ 4 │ ├╼ 0 │ ├╼ 2 │ │ ├╼ 0 │ │ └╼ 1 │ │ └╼ 0 │ └╼ 3 │ ├╼ 0 │ └╼ 2 │ ├╼ 0 │ └╼ 1 │ └╼ 0 └╼ 6 ├╼ 0 ├╼ 3 │ ├╼ 0 │ └╼ 2 │ ├╼ 0 │ └╼ 1 │ └╼ 0 └╼ 5 ├╼ 0 ├╼ 3 │ ├╼ 0 │ └╼ 2 │ ├╼ 0 │ └╼ 1 │ └╼ 0 └╼ 4 ├╼ 0 ├╼ 2 │ ├╼ 0 │ └╼ 1 │ └╼ 0 └╼ 3 ├╼ 0 └╼ 2 ├╼ 0 └╼ 1 └╼ 0 ``` The first level of the tree is exactly the same, but then the size of the tree reduces significantly as all duplication is removed. This is currently just for `integral`, but as integral is used for `element`, this should improve things pretty broadly.
- Loading branch information