on master help sign in
Add noVersion
commit6b7fbad7fe8634fd3c1fec37636bde7609270d31 authorJasper Van der Jeugt <m@jaspervdj.be> dateSun 6 Jan 2013, 08:56 (14 years ago) parent603d00f
1 file changed+7
src/Hakyll/Core/Identifier/Pattern.hs+7
src/Hakyll/Core/Identifier/Pattern.hs+7
@@ -43,6 +43,7 @@ module Hakyll.Core.Identifier.Pattern
4343 , (.||.)
4444 , complement
4545 , withVersion
46+ , noVersion
4647 , fromLiteral
4748
4849 -- * Applying patterns
@@ -227,6 +228,12 @@ withVersion :: Pattern -> String -> Pattern
227228withVersion p v = optimize $ And p $ fromVersion $ Just v
228229
229230
231+--------------------------------------------------------------------------------
232+-- | Match only if the identifier has no version set
233+noVersion :: Pattern -> Pattern
234+noVersion p = optimize $ And p $ fromVersion Nothing
235+
236+
230237--------------------------------------------------------------------------------
231238-- | Check if a pattern is a literal. @\"*.markdown\"@ is not a literal but
232239-- @\"posts.markdown\"@ is.