@@ -20,6 +20,15 @@
20-- @posts/foo.html@. In this case, the identifier is the name of the source
20-- @posts/foo.html@. In this case, the identifier is the name of the source
21-- file of the page.
21-- file of the page.
23+-- An `Identifier` carries the type of the value it identifies. This basically
24+-- means that an @Identifier (Page String)@ refers to a page.
26+-- It is a phantom type parameter, meaning you can safely change this if you
27+-- know what you are doing. You can change the type using the 'castIdentifier'
30+-- If the @a@ type is not known, Hakyll traditionally uses @Identifier ()@.
23{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
32{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
24module Hakyll.Core.Identifier
33module Hakyll.Core.Identifier
25 ( Identifier (..)
34 ( Identifier (..)
@@ -41,12 +50,6 @@ import Data.Typeable (Typeable)
42-- | An identifier used to uniquely identify a value
51-- | An identifier used to uniquely identify a value
44−-- The @a@ is used to denote the type that the identifier points to. It is a
45−-- phantom type parameter, meaning you can safely change this if you know what
48−-- If the @a@ type is not known, Hakyll traditionally uses @Identifier ()@.
50data Identifier a = Identifier
53data Identifier a = Identifier
51 { identifierGroup :: Maybe String
54 { identifierGroup :: Maybe String
52 , identifierPath :: String
55 , identifierPath :: String