[darcs-users] darcs patch: remove some derived classes from Tag
Ganesh Sittampalam
ganesh at earth.li
Sun Aug 30 22:36:37 UTC 2009
On Sun, 30 Aug 2009, Jason Dagit wrote:
> On Sun, Aug 30, 2009 at 5:32 AM, Ganesh Sittampalam<ganesh at earth.li> wrote:
>> Mon Jul 27 07:02:03 BST 2009 Ganesh Sittampalam <ganesh at earth.li>
>> * remove some derived classes from Tag
>> This helps to make the representation more abstract
>
> - identity = TP (-1) identity
> + identity = TP (TG (-1)) identity
>
> -patch_choices_tps ps = let tps = zipWithFL TP [1..] ps
> +patch_choices_tps ps = let tps = zipWithFL TP (map TG [1..]) ps
>
> I guess those were necessary because you removed the Enum instance?
And the Num instance.
> This patch is border line churn to me, but I'm willing to trust
> Ganesh's experience/wisdom that it makes the code better, even if I
> don't (yet) understand why.
The real reason is actually that I also wrote the patch I attached to
http://bugs.darcs.net/issue291 at the same time, but that second patch
isn't appropriate to submit right away because nothing needs the extra
functionality it provides until we have a proper patch splitting
interface. So the justification for this refactoring in itself is that
it's easier to check that it's behaviour preserving, it does improve the
code in the sense that it reduces the surface area of a type that is
exposed to other modules, and that there may well be a concrete use for it
in future.
Cheers,
Ganesh
More information about the darcs-users
mailing list