darcs

Patch 2335 break out Darcs.Test.Patch.Types.Triple (and 8 more)

Title break out Darcs.Test.Patch.Types.Triple (and 8 more)
Superseder Nosy List ganesh
Related Issues
Status accepted Assigned To
Milestone

Created on 2023-07-16.11:46:41 by ganesh, last changed 2023-08-19.12:50:27 by bfrk.

Files
File name Status Uploaded Type Edit Remove
break-out-darcs_test_patch_types_triple.dpatch ganesh, 2023-07-16.11:46:40 application/x-darcs-patch
patch-preview.txt ganesh, 2023-07-16.11:46:40 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg23584 (view) Author: ganesh Date: 2023-07-16.11:46:40
I'm not going to screen these immediately in case
they conflict with any other WIP or there are objections.

The only behaviour change is in

* Replace Arbitrary ByteString instances with quickcheck-instances

which moves us from just wrapping the String instance to using this:

https://github.com/haskellari/qc-instances/blob/master/src/Test/QuickCheck/Instances/ByteString.hs

I'm not particularly attached to the choice, we could also
just have an orphan in a single module in our own code (as opposed
to the multiple different places we have now).

Other than that it's just some simple cleanups:

1) Trying to break "mega-modules" apart into smaller
ones with clearer themes or focused around a specific
type.

2) Cut down our orphan instances. We do need orphans
but I think we should try to constrain the set of modules
we keep them in and only have one instance per class/type, not
different possibly clashing ones.

The longer-term direction is as discussed in patch2166, i.e.
cut down all the different ways we are currently doing things.
My goal would be to have everything using the generators/types
that have good shrinking. When I started on trying to simplify
things I found I was spending a lot of time just chasing code
around so I'd also like to untangle confusing module dependencies
(most of which I probably created in the first place!)

9 patches for repository darcs-unstable@darcs.net:/opt/darcs/screened:

patch 5ce6a8ea54afc7dc004cc4782def98b3d68f619a
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 17:28:54 BST 2023
  * break out Darcs.Test.Patch.Types.Triple

patch f27109f502dddd13edbf21f017c7098b62ccb41f
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 19:27:23 BST 2023
  * break out Darcs.Test.Patch.Properties

  Recorded as move-and-recreate as most of the content
  of Darcs.Test.Patch is moving.

patch 40e3044e6658f424acaea9654b5f4bca1e8ec8b1
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 19:38:16 BST 2023
  * harness: mark files with orphan instances explicitly

patch 971bece12f5e584a7daa44bcd81a132fdce06cdb
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 20:10:53 BST 2023
  * Replace Arbitrary ByteString instances with quickcheck-instances

patch d3d760493bc15c083a5d7da4954c2d3abea84e76
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 20:17:01 BST 2023
  * move ArbitraryWS (FL p) instance

  The comment about avoiding overlap seems to be obsolete

patch af0cf48fe2a43da3dced99ae9c01b872909fcb5e
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 20:19:20 BST 2023
  * drop unused orphan instance

patch 0e48660d4a9817147b8427c8f5f61924bd9ca51d
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 21:06:52 BST 2023
  * break out Darcs.Test.Patch.Types.Pair

patch 43eb41f908762a15b06d5f61c6c2d68ce8f58812
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jul 10 23:14:06 BST 2023
  * break out Darcs.Test.Patch.Types.MergeableSequence

patch 805f88a2c222700a3f9f2ab7b8b19155fd71dbfb
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Sat Jul 15 16:56:32 BST 2023
  * break out Darcs.Test.Patch.Types.Merged
Attachments
msg23659 (view) Author: ganesh Date: 2023-08-06.21:30:13
Screening this now. As it's just test changes I'll probably self-accept
in a while, but leaving them available for review for a bit.
msg23662 (view) Author: bfrk Date: 2023-08-07.08:39:51
> * break out Darcs.Test.Patch.Properties
> 
> Recorded as move-and-recreate as most of the content
> of Darcs.Test.Patch is moving.

Not sure I would have done that but okay. And thanks for using move here, 
which will hopefully make it easier to rebase my pending changes to the 
harness, though I guess I will still get a few conflicts.

> * harness: mark files with orphan instances explicitly

I agree this is better.

> * Replace Arbitrary ByteString instances with quickcheck-instances

Very nice cleanup! I wasn't aware that we had three separate but equal 
instances for ByteString.

> * move ArbitraryWS (FL p) instance
> * drop unused orphan instance

Trivial cleanups, fine.

> * break out Darcs.Test.Patch.Types.Triple
> * break out Darcs.Test.Patch.Types.Pair
> * break out Darcs.Test.Patch.Types.MergeableSequence
> * break out Darcs.Test.Patch.Types.Merged

These all make sense to me. I also had trouble in the past to remember in 
which module these data types are defined.
History
Date User Action Args
2023-07-16 11:46:41ganeshcreate
2023-07-16 15:04:03ganeshsetstatus: needs-screening -> in-discussion
2023-08-06 21:22:02ganeshsetstatus: in-discussion -> needs-screening
2023-08-06 21:30:14ganeshsetstatus: needs-screening -> needs-review
messages: + msg23659
2023-08-07 08:39:51bfrksetstatus: needs-review -> accepted-pending-tests
messages: + msg23662
2023-08-19 12:50:27bfrksetstatus: accepted-pending-tests -> accepted