gen.subsequence / shuffle / nonEmptyListOf / uniqueListOf #11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Missing
Small list combinators every framework ships:
gen.subsequence xs— each element kept or dropped; shrinks toward dropping (HedgehogGen.subsequence).gen.shuffle xs(HedgehogGen.shuffle, fast-checkshuffledSubarray).gen.nonEmptyListOf g.gen.uniqueListOf lenRange g(fast-checkuniqueArray); needs the filter/discard machinery or drop-duplicates.Why
subsequenceis the building block forgen.attrsWith(#4) and for "subset of declared property names" in jsonschema2nix. The others are a few lines each and keep callers from reimplementing them withbind.Suggested shape
subsequence = xs: map (flags: filter by flags) (vectorOf (length xs) bool)—boolshrinkstrue -> false, so the list shrinks toward[ ].Implemented in
60d0c55, pushed to main.