[darcs-devel] [patch2163] substantial rewrite of 'darcs test'

Ganesh Sittampalam bugs at darcs.net
Sun Apr 18 07:19:26 UTC 2021


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

These patches are possible followups for a couple of
review comments (in the thread I linked above).

They introduce a bit more machinery that may not
be justified so I'll wait a bit before screening.

The first one introduces asks. As TestingEnv is a
newtype around ReaderT, I introduced a MonadReader
type class like in the mtl so that I could write
a generic asks that would work on TestingEnv:

patch 230c86f199e7b43eab49213ad633885176c72b45
Author: Ganesh Sittampalam <ganesh at earth.li>
Date:   Sat Apr 17 19:49:01 BST 2021
  * follow the mtl a bit more for ReaderT
  
  - move it to Darcs.Util.IndexedMonad
  - introduce a MonadReader class and 'asks'
  - use a record for TestingEnv so we can use asks

This one gets rid of testableToRL. The only places
it was used were to convert a Testable before calling
applyRL. Now I've made the concept of "indexed" apply
work on several container types (RL, FL, Testable) so
this conversion isn't needed.

It does introduce some extra constraints for reasons
explained in a comment on TestRunnerPatchReqs, and
also in the unit tests I had to introduce an 'IndexedApply'
class because there is no code for the testing patch
types to operate on non-indexed monads.

I think it does make the use of applyPatches look a bit
nicer, and it also demonstrates that the only real
conversion away from Testable is after the strategy
is complete:

patch 8ab043a7ee356caec8701be759cb3d298a77b258
Author: Ganesh Sittampalam <ganesh at earth.li>
Date:   Sat Apr 17 23:12:23 BST 2021
  * replace applyRL/unapplyRL with applyPatch/unapplyPatch

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch2163>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 12096 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20210418/b845a7fb/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: follow-the-mtl-a-bit-more-for-readert.dpatch
Type: application/x-darcs-patch
Size: 20252 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20210418/b845a7fb/attachment-0003.bin>
-------------- next part --------------
.





More information about the darcs-devel mailing list