diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-11 18:10:45 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-11 18:10:45 +0200 |
commit | b9efc54e931bae76a3a2255bc07249210f2abc62 (patch) | |
tree | 31eda60b95f9529b09aa47909b8889adc55c3bf1 /src/Hakyll | |
parent | 15045d313c9d23014fcf284625a90d67d3a10d4d (diff) | |
download | hakyll-b9efc54e931bae76a3a2255bc07249210f2abc62.tar.gz |
Set and check identifier groups
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/Identifier.hs | 12 |
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' |