From 6b7fbad7fe8634fd3c1fec37636bde7609270d31 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 6 Jan 2013 08:56:51 +0100 Subject: Add noVersion --- src/Hakyll/Core/Identifier/Pattern.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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 @@ -227,6 +228,12 @@ withVersion :: Pattern -> String -> Pattern 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. -- cgit v1.2.3