nick8325 / nick8325/quickcheck

Cleanup of definitional modules

Open
#463 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
790
Forks
130
Avg merge
16h 41m
Merged PRs (30d)
2

Description

I was going to set off on https://github.com/nick8325/quickcheck/issues/459, but found it incredibly hard to navigate Test.QuickCheck.Arbitrary; typeclasses and instances are scatted across the two thousand lines of CPP'd instances, making it hard to track what is defined where.

I would suggest that we make two changes: firstly, move the classes into their own modules (Test.QuickCheck.Arbitrary.Class, Test.QuickCheck.Arbitrary1.Class, Test.QuickCheck.CoArbitrary.Class; or just move all the classes to a Test.QuickCheck.Arbitrary.Class); secondly, reorganise instance definitions either on a class by class basis (Test.QuickCheck.Arbitrary.Instances) or on a type origin by type origin basis (like in https://github.com/haskellari/qc-instances/tree/master/src/Test/QuickCheck/Instances, resulting in Test.QuickCheck.Instances.Semigroup and so on). This would result in many orphan instances, but those are easily resolved by exporting them from the same Test.QuickCheck.Arbitrary as before.

I'm happy to have a go at this, but thought I should ask before setting off.

I would also ask for guidance on what this breaking up and cleaning up should look like.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Test.QuickCheck.Arbitrary and the related issue 459 to understand the navigation problem across its roughly 2,000 lines of CPP'd instances. Compare the proposed class-based and type-origin-based module layouts, including the qc-instances example. Done means the classes and instances are reorganized while the existing Test.QuickCheck.Arbitrary exports remain available, but the issue requests maintainer guidance before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.