In the QuickChick implementation for Testing Theorems, we use Tarjan's algorithm to perform a topological sort of all typeclass instance dependencies (e.g. ArbitrarySuchThat instances) when deriving generators, then proceed to derive these ArbitrarySuchThat instances according to this order. (In the underlying graph, each strongly-connected component is a set of mutually recursive inductive relations.)
Right now, Chamelean doesn't do this, so it has to resort to emitting warnings telling the user to derive ArbitrarySuchThat / EnumSuchThat instances for propositions when it detects that another constrained producer is required. To improve Chamelean's UX, it would be nice if Chamelean adopted QuickChick's approach of sorting these dependencies and deriving them in order automatically.
In the QuickChick implementation for Testing Theorems, we use Tarjan's algorithm to perform a topological sort of all typeclass instance dependencies (e.g.
ArbitrarySuchThatinstances) when deriving generators, then proceed to derive theseArbitrarySuchThatinstances according to this order. (In the underlying graph, each strongly-connected component is a set of mutually recursive inductive relations.)Right now, Chamelean doesn't do this, so it has to resort to emitting warnings telling the user to derive
ArbitrarySuchThat/EnumSuchThatinstances for propositions when it detects that another constrained producer is required. To improve Chamelean's UX, it would be nice if Chamelean adopted QuickChick's approach of sorting these dependencies and deriving them in order automatically.