[darcs-devel] [patch1979] better shrinking for patches

Ganesh Sittampalam bugs at darcs.net
Sun Feb 23 09:03:23 UTC 2020


Ganesh Sittampalam <ganesh at earth.li> added the comment:

On 23/02/2020 08:04, Ben Franksen wrote:

> I would really like to see all the necessary machinery for Named patches
> being added. A lot of that already seems to be there, so why not go all
> the way and then actually use it to test properties for Named patches?

I did it, but it's tangled up with my draft unwind changes. I just
uploaded the current state to darcs hub:

https://hub.darcs.net/ganesh/darcs-unwind-draft-20200223/browse/harness/Darcs/Test/Patch/Arbitrary/Named.hs

I could move the extra instances over to this patch but they still
wouldn't be used until I submit the unwind changes. That ought to be
soon as I've worked through most of the necessary cleanups.

> However, I stumbled over one detail that isn't immediately obvious to
> me. You have now added vacuous instances Shrinkable Prim for various
> Prim types e.g.
> 
> instance Shrinkable V1.Prim where
>   shrinkInternally _ = []
>   shrinkAtEnd _ = []
>   shrinkAtStart _ = []
> 
> It is unclear to me why these are needed, and I find them a bit ugly. Is
> there a way to get rid of them, and if not, why are they needed?

This is basically the same explanation as in

http://bugs.darcs.net/msg21791

The vacuous instances for RepoPatch have now moved down a level to Prim.
While I probably could get rid of the instances, I think it's better to
leave them as TODOs to expand on later.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1979>
__________________________________


More information about the darcs-devel mailing list