On Sun, Nov 15, 2009 at 8:15 AM, Ganesh Sittampalam <[email protected]> wrote:
> On Sun, 15 Nov 2009, Jason Dagit wrote: > > toCommute and fromCommute are not the best function names, but I think >> a future refactor can get rid of both of them or give them better >> names. I've also tried to make their types sufficiently general such >> that they may be able to transform the type of commuteFL, although I >> haven't actually tried it. >> > > A little while ago I started adding some general infrastructure for > handling commutes between different types of patches in > Darcs.Patch.Permutations - in particular there's > > type CommuteFn p1 p2 = FORALL(x y) (p1 :> p2) C(x y) -> Maybe ((p2 :> p1) > C(x y)) > > I think it would make sense to combine this stuff with your toCommute and > fromCommute code, and put it in an appropriate module (perhaps a new one). > Ganesh, It's unclear to me: Were you going to apply this? I see it hasn't made it into darcs.net yet, and the status is "amend-requested" but I thought you were commenting on future work above. Did you feel that I need to include a usage of CommuteFn at the same time? If so, I think we could use a different set of patches for that. Take for example this output: $ find src/ | xargs grep "type.*Commute" src/Darcs/Patch/Commute.lhs:type CommuteFunction = FORALL(x y) (Patch :< Patch) C(x y) -> Perhaps ((Patch :< Patch) C(x y)) src/Darcs/Patch/Commute.lhs:type MaybeCommute = FORALL(x y) (Patch :< Patch) C(x y) -> Maybe ((Patch :< Patch) C(x y)) src/Darcs/Patch/Permutations.hs:type CommuteFn p1 p2 = FORALL(x y) (p1 :> p2) C(x y) -> Maybe ((p2 :> p1) C(x y)) src/Darcs/Patch/Prim.lhs:type CommuteFunction = FORALL(x y) (Prim :< Prim) C(x y) -> Perhaps ((Prim :< Prim) C(x y)) It looks to me like there is a bit of thinking to be done about unifying the above and refactoring it properly. I agree it needs to happen, but I'd prefer it to be independent of the removal of commutex (mainly because that bit has already been done, and the refactor of the types would delay it getting into darcs). What do you think? Jason
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
