summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-01-06 08:56:51 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2013-01-06 08:56:51 +0100
commit6b7fbad7fe8634fd3c1fec37636bde7609270d31 (patch)
tree22427e6143123b2d538e2812b619301b264b152b
parent603d00fd566dac5869129a4f831b3ed9ee112afc (diff)
downloadhakyll-6b7fbad7fe8634fd3c1fec37636bde7609270d31.tar.gz
Add noVersion
-rw-r--r--src/Hakyll/Core/Identifier/Pattern.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Identifier/Pattern.hs b/src/Hakyll/Core/Identifier/Pattern.hs
index 8fbc6f8..3a07219 100644
--- a/src/Hakyll/Core/Identifier/Pattern.hs
+++ b/src/Hakyll/Core/Identifier/Pattern.hs
@@ -43,6 +43,7 @@ module Hakyll.Core.Identifier.Pattern
, (.||.)
, complement
, withVersion
+ , noVersion
, fromLiteral
-- * Applying patterns
@@ -228,6 +229,12 @@ withVersion p v = optimize $ And p $ fromVersion $ Just v
--------------------------------------------------------------------------------
+-- | Match only if the identifier has no version set
+noVersion :: Pattern -> Pattern
+noVersion p = optimize $ And p $ fromVersion Nothing
+
+
+--------------------------------------------------------------------------------
-- | Check if a pattern is a literal. @\"*.markdown\"@ is not a literal but
-- @\"posts.markdown\"@ is.
fromLiteral :: Pattern -> Maybe Identifier