Set and check identifier groups
This commit is contained in:
parent
15045d313c
commit
b9efc54e93
1 changed files with 12 additions and 0 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue