summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Identifier.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/Identifier.hs')
-rw-r--r--src/Hakyll/Core/Identifier.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Identifier.hs b/src/Hakyll/Core/Identifier.hs
index 5b205f1..1cb625f 100644
--- a/src/Hakyll/Core/Identifier.hs
+++ b/src/Hakyll/Core/Identifier.hs
@@ -25,6 +25,8 @@ module Hakyll.Core.Identifier
( Identifier (..)
, parseIdentifier
, toFilePath
+ , setGroup
+ , hasGroup
) where
import Control.Arrow (second)
@@ -73,3 +75,13 @@ parseIdentifier = Identifier Nothing
--
toFilePath :: Identifier -> FilePath
toFilePath = identifierPath
+
+-- | Set the identifier group for some identifier
+--
+setGroup :: String -> Identifier -> Identifier
+setGroup g (Identifier _ p) = Identifier (Just g) p
+
+-- | Check if an identifier belongs to a certain group
+--
+hasGroup :: String -> Identifier -> Bool
+hasGroup g (Identifier g' _) = Just g == g'