Skip to content

Sort ArbitrarySuchThat Instance Dependencies in Topological Order When Deriving Generators #46

Description

@ngernest

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions