Set and check identifier groups

This commit is contained in:
Jasper Van der Jeugt 2011-04-11 18:10:45 +02:00
parent 15045d313c
commit b9efc54e93

View file

@ -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'