sorellabs / claire

[Unmaintained: please use jsverify instead] A property-based testing library for clearly specifying code invariants and behaviour.
MIT License
79 stars 4 forks source link

Add other kinds of quantifications? ∃x. p(x)? #8

Open robotlolita opened 11 years ago

robotlolita commented 11 years ago

SmallCheck has three different kinds of quantifications for properties: existential, universal and unique existential. Perhaps it would be interesting to support existential quantification alongside the current universal quantification(?)

API would follow naturally from the current Property type:

exists( Type ).given( a → Bool).satisfy( a → Bool )

We'd have to gather use-cases of where existential quantification is desirable, however. While this is rather easy to add, it should be only added if the use-cases justify the increased complexity in the API.