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

Ganesh Sittampalam ganesh at earth.li
Thu Apr 22 19:31:53 UTC 2021


On 22/04/2021 14:42, Ben Franksen wrote:

> Working with Repository instead of an indexed ApplyState is more
> complicated. You have 4 or 5 witnesses to take care of instead of one.
> And as soon as you read a tree from a Repository, you loose the more
> precise typing. In particular, it doesn't work well in situations where
> we manipulate several trees in different directories like we do e.g. for
> 'darcs diff'.

Sorry, I wasn't clear. What I meant was that in many places we already
track application via the Repository type, and we wouldn't want to also
start passing PureApplyState around. PureApplyState would be useful for
cases where we don't have a Repository, such as in 'darcs test'.

> I won't suggest you shouldn't play with this idea, but w.r.t. screened I
> would rather first consolidate the code in its current shape with the
> indexed monad.

Agreed. I am actively working on the consolidation.

> Also, I have a strong feeling that working with witness
> typed Trees directly will be a lot easier and more flexible than with
> the somewhat bulky Repository type, so I would rather first add this
> alternative Apply interface and some infrastructure on top of that
> before we commit to any substantial re-write of 'darcs test'; which,
> ceterum censeo, should be renamed back to 'trackdown' ;-)

TBH I don't think it would need much infrastructure. Like Repository,
PureApplyState just needs to be a token constructed out of nowhere.
Later we can change Apply itself to insist on being passed it, but it's
not essential to begin with.

> And I hope that using linear types doesn't mean we have to add even more
> complications to get the witness typing right ;-)

Yes, that is a risk.

> In some sense what
> Darcs does with the witnesses is still very much "advanced" Haskell,
> even though the mechanisms (i.e. language extensions) we use are all
> well established. So I think Darcs is a very good test bed for trying
> out new features, albeit in a somewhat negative sense: together with our
> ubiquitous witness typing there is a realistic chance that any new
> features will disqualify themselves as being impractical to use. And I
> think we should communicate these experiences (good or bad) to inform
> the wider community.

Agreed. (Though it's easy for me to have good intentions and not follow
through :-))

Ganesh


More information about the darcs-devel mailing list