[darcs-devel] [patch2143] option refactors

Ben Franksen bugs at darcs.net
Tue Mar 23 18:30:52 UTC 2021


Ben Franksen <ben.franksen at online.de> added the comment:

>>  * unify diffing options
> 
> This looks nice, especially dropping ScanKnown.
> 
> In a few places we end up with
> 
>>    ^ O.lookforadds
>>    ^ O.lookforreplaces
>>    ^ O.lookformoves
> 
> instead of
> 
>>    ^ O.lookfor
> 
> Could that helper be kept? Or do the types not work out?

The typing is no problem. But amend and record have O.lookforadds (which
is synonym for O.maybelookforadds False), while whatsnew has
O.maybelookforadds False and status has O.maybelookforadds True. So
either O.lookfor gets an argument to indicate the default value for the
lookfor option, or else it cannot be used for the status command.

>>   * amend and record commands: back to using [DarcsFlag]
> 
> Fair enough - shame about the experiment

True, I guess that's why it took me so long to admit defeat ;-)

This problem can only be solved properly with extensible records. For
the time being [DarcsFlag] is our weakly typed emulation of that. The
important point is that it is treated like an abstract data type now. I
guess we could wrap it with a newtype and make it technically abstract
nowadays.

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


More information about the darcs-devel mailing list