hakyll/src/Hakyll/Core/ResourceProvider.hs

23 lines
788 B
Haskell
Raw Normal View History

2010-12-24 07:42:05 +00:00
-- | This module provides an API for resource providers. Resource providers
-- allow Hakyll to get content from resources; the type of resource depends on
-- the concrete instance.
--
module Hakyll.Core.ResourceProvider
( ResourceProvider (..)
) where
import Hakyll.Core.Identifier
2010-12-26 15:12:24 +00:00
import qualified Data.ByteString.Lazy as LB
2010-12-24 07:42:05 +00:00
-- | A value responsible for retrieving and listing resources
--
data ResourceProvider = ResourceProvider
{ -- | A list of all resources this provider is able to provide
2010-12-26 15:12:24 +00:00
resourceList :: [Identifier]
2010-12-24 07:42:05 +00:00
, -- | Retrieve a certain resource as string
2010-12-26 15:12:24 +00:00
resourceString :: Identifier -> IO String
, -- | Retrieve a certain resource as lazy bytestring
resourceLazyByteString :: Identifier -> IO LB.ByteString
2010-12-24 07:42:05 +00:00
}