On Thu, Sep 04, 2008 at 11:19:12AM +0100, Eric Y. Kow wrote:
> rename get_patches_beyond_tag and add more typeful version
> ----------------------------------------------------------
> > -                      :>: reverseRL (concatRL $ unsafeUnflippedseal $ 
> > get_patches_beyond_tag chtg patches)
> > +                      :>: reverseRL (concatRL $ unsafeUnflippedseal $ 
> > get_patches_beyond_taginfo chtg patches)
>
> Hmm. Would a darcs replace not have been practical or sensible here?

I'm curious as to the motivation for this renaming.  It seems to me
that get_patches_beyond_tag is more accurate than
get_patches_beyond_taginfo.  True, the tag is described by a
PatchInfo, but it is the tag itself that we're getting the patches
that are beyond.

> > -get_patches_beyond_tag :: RepoPatch p => PatchInfo -> PatchSet p C(x) -> 
> > FlippedSeal (RL (RL (PatchInfoAnd p))) C(x)
> > -get_patches_beyond_tag t ((hp:<:NilRL):<:_) | info hp == t = flipSeal $ 
> > NilRL :<: NilRL
> > +get_patches_beyond_tag :: RepoPatch p => (PatchInfoAnd p) C(x y) -> 
> > PatchSet p C(z) -> (RL (RL (PatchInfoAnd p))) C(y z)
> > +get_patches_beyond_tag t ((hp:<:NilRL):<:_) | IsEq <- sloppyIdentity t
> > +                                            , IsEq <- sloppyIdentity hp
> > +                                            , info hp == info t = 
> > unsafeCoerceP $ NilRL :<: NilRL
...
> My understanding of this function (and Jason's more typeful version) is
> that it retrieves the patches that come "chronologically after" a tag.
> We just walk down the entire patchset, returning each patch in sequence
> /until/ we hit the tag in question.  This is the case below

I would avoid the terminology "chronologically after", and just say
that it retrieves the patches that aren't in the tag.

> > + prepend :: (PatchInfoAnd p) C(a z) -> (RL (RL (PatchInfoAnd p))) C(y a) 
> > -> (RL (RL (PatchInfoAnd p))) C(y z)
> > + prepend pp NilRL = (pp:<:NilRL) :<: NilRL
> > + prepend pp (p:<:ps') = (pp:<:p) :<: ps'
>
> Again a comment on darcs and not on Jason's code.  I wonder if there is
> something more efficient than (p `prepend` next) that we ought to be
> doing here.

It's hard to see what could be more efficient than prepend...

David

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to