Refactor actual_boring_file_filter.
-----------------------------------
> +-- | From a list of paths, filter out any that are within @_darcs@ or
> +-- match a boring regexp.
>  actual_boring_file_filter :: [Regex] -> [FilePath] -> [FilePath]
> hunk ./src/Darcs/Repository/Prefs.lhs 289
> -actual_boring_file_filter regexps fs =
> -    filter (abf (not.is_darcsdir) regexps . normalize) fs
> -    where
> -    abf fi (r:rs) = abf (\f -> fi f && isNothing (matchRegex r f)) rs
> -    abf fi [] = fi

> +actual_boring_file_filter regexps files = filter (not . boring) files
> +    where boring file = is_darcsdir file ||
> +                        any (\regexp -> isJust $ matchRegex regexp file) 
> regexps

No more normalize?  Why not?

Also, you can eta-reduce your version if you want:

  actual_boring_file_filter regexps = filter (not . boring)


Refactor darcs_binaries.
------------------------
> Trent W. Buck <[email protected]>**20090117135906
>  Ignore-this: 76174e648ec72ace6f26e6372a4e816
>  
>  Instead of creating a very long list of simple regexps, this now
>  creates two regexps of the form \.(a|b|...|z)$, the latter being
>  uppercase.  I have also combined some extension variants (e.g. .jpe?g
>  instead of two entries .jpg and .jpeg) and sorted the extension list.
>  
>  I've elected NOT to use Emacs' regexp-opt to build a faster regexp,
>  because that would make it very hard for end users to find and remove
>  an extension from the default list.  I think merging .jpe?g is OK.

But would the very long list of simpler regexps easier for human beings
to work with? (i.e. you look into binaries file and instantly understand
how to add something by copy and pasting... notably by inserting a whole
new line, not by modifying a pre-existing one)

Also, I wonder if there is a way within the regexp to request case
insensitive matching

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

Attachment: signature.asc
Description: Digital signature

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

Reply via email to