diff options
| author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-11 21:57:33 +0200 |
|---|---|---|
| committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-11 21:57:33 +0200 |
| commit | f9699509771346ec53c0acc82c014a355857557d (patch) | |
| tree | 6a67fdad6832b689376079c432f5a66ca82dd3bf /src/Hakyll/Core/Identifier | |
| parent | b9efc54e931bae76a3a2255bc07249210f2abc62 (diff) | |
| download | hakyll-f9699509771346ec53c0acc82c014a355857557d.tar.gz | |
Playing around with groups
Diffstat (limited to 'src/Hakyll/Core/Identifier')
| -rw-r--r-- | src/Hakyll/Core/Identifier/Pattern.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Identifier/Pattern.hs b/src/Hakyll/Core/Identifier/Pattern.hs index 348ef46..cee4bbc 100644 --- a/src/Hakyll/Core/Identifier/Pattern.hs +++ b/src/Hakyll/Core/Identifier/Pattern.hs @@ -36,6 +36,7 @@ module Hakyll.Core.Identifier.Pattern , parseGlob , predicate , regex + , inGroup , matches , filterMatches , capture @@ -106,6 +107,12 @@ predicate = Predicate regex :: String -> Pattern regex str = predicate $ fromMaybe False . (=~~ str) . toFilePath +-- | Create a 'Pattern' which matches if the identifier is in a certain group +-- (or in no group) +-- +inGroup :: Maybe String -> Pattern +inGroup group = predicate $ (== group) . identifierGroup + -- | Check if an identifier matches a pattern -- matches :: Pattern -> Identifier -> Bool |
