[darcs-devel] darcs patch: Rename (again) query/list to show. (and 3 more)

Eric Y. Kow eric.kow at gmail.com
Tue Jul 31 13:22:56 PDT 2007


> Mon Jul 30 22:23:08 CEST 2007  Eric Kow <eric.kow at gmail.com>
>   * Refactor unapply helper functions in Darcs.Match.

Well, crud.  I messed this one up.

> +unapply_to_inclusive :: WriteableDirectory m => Matcher -> [(PatchInfo, Hopefully Patch)] -> m ()
> +unapply_to_inclusive mat = mapM_ uti
> + where uti p | apply_matcher mat p = apply_invp p >> mzero
> +             | otherwise           = apply_invp p
> +
> +unapply_to :: WriteableDirectory m => Matcher -> [(PatchInfo, Hopefully Patch)] -> m ()
> +unapply_to mat = mapM_ ut
> + where ut p | apply_matcher mat p = mzero
> +            | otherwise           = apply_invp p

I didn't want mzero here.  Mzero is for failure, whereas here I wanted
just regular old stopping.  Me and my monad non-mastery.  I guess we
could still keep the refactor but still have that explict recursion.

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070731/82714679/attachment.pgp


More information about the darcs-devel mailing list