Eric Kow <ko...@darcs.net> writes:

> On Sun, Jun 06, 2010 at 17:02:26 +0100, Eric Kow wrote:
>> > Sun Jun  6 16:21:25 CEST 2010  Petr Rockai <m...@mornfall.net>
>> > +renameChanged from to = modify $ \st -> st { changed = rename' $ changed 
>> > st }
>> > +  where rename' = S.fromList . map renameone . S.toList
>
> There's S.map if you're interested.
>
>> > +        renameone x | from `isPrefix` x = to `catPaths` relative from x
>> > +                    | otherwise = x
>> > +        relative (AnchoredPath from) (AnchoredPath x) = AnchoredPath $ 
>> > drop (length from) x
>
>> Do we have to worry about things like initial/trailing slashes in from
>> and x?
>
> Also, will this do the right thing if from is something like "foo" and x
> is something like "foobar"?
AnchoredPath is a list of path components, not of characters... all the
cases you mention should be covered quite well (no slash characters are
allowed in AnchoredPath ever and components cannot interfere in this way
either).

Yours,
   Petr.
_______________________________________________
darcs-users mailing list
darcs-users@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to