on 5dba607 help sign in
hakyll/src/Hakyll/Core/Resource.hs
24 lines 590 B history raw
1-- | Module exporting the simple 'Resource' type
2--
3module Hakyll.Core.Resource
4 ( Resource (..)
5 , fromIdentifier
6 , toIdentifier
7 ) where
9import Hakyll.Core.Identifier
11-- | A resource
12--
13newtype Resource = Resource {unResource :: String}
14 deriving (Eq, Show, Ord)
16-- | Create a resource from an identifier
17--
18fromIdentifier :: Identifier a -> Resource
19fromIdentifier = Resource . toFilePath
21-- | Map the resource to an identifier. Note that the group will not be set!
22--
23toIdentifier :: Resource -> Identifier a
24toIdentifier = parseIdentifier . unResource