module Text.DublinCore.Types
( DCItem(..)
, DCInfo(..)
, infoToTag
, dc_element_names
) where
import Prelude.Compat
import Data.Text
data DCItem =
DCItem
{ DCItem -> DCInfo
dcElt :: DCInfo
, DCItem -> Text
dcText :: Text
}
deriving (DCItem -> DCItem -> Bool
(DCItem -> DCItem -> Bool)
-> (DCItem -> DCItem -> Bool) -> Eq DCItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DCItem -> DCItem -> Bool
$c/= :: DCItem -> DCItem -> Bool
== :: DCItem -> DCItem -> Bool
$c== :: DCItem -> DCItem -> Bool
Eq, Int -> DCItem -> ShowS
[DCItem] -> ShowS
DCItem -> String
(Int -> DCItem -> ShowS)
-> (DCItem -> String) -> ([DCItem] -> ShowS) -> Show DCItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DCItem] -> ShowS
$cshowList :: [DCItem] -> ShowS
show :: DCItem -> String
$cshow :: DCItem -> String
showsPrec :: Int -> DCItem -> ShowS
$cshowsPrec :: Int -> DCItem -> ShowS
Show)
data DCInfo
= DC_Title
| DC_Creator
| DC_Subject
| DC_Description
| DC_Publisher
| DC_Contributor
| DC_Date
| DC_Type
| DC_Format
| DC_Identifier
| DC_Source
| DC_Language
| DC_Relation
| DC_Coverage
| DC_Rights
| DC_Other Text
deriving (DCInfo -> DCInfo -> Bool
(DCInfo -> DCInfo -> Bool)
-> (DCInfo -> DCInfo -> Bool) -> Eq DCInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DCInfo -> DCInfo -> Bool
$c/= :: DCInfo -> DCInfo -> Bool
== :: DCInfo -> DCInfo -> Bool
$c== :: DCInfo -> DCInfo -> Bool
Eq, Int -> DCInfo -> ShowS
[DCInfo] -> ShowS
DCInfo -> String
(Int -> DCInfo -> ShowS)
-> (DCInfo -> String) -> ([DCInfo] -> ShowS) -> Show DCInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DCInfo] -> ShowS
$cshowList :: [DCInfo] -> ShowS
show :: DCInfo -> String
$cshow :: DCInfo -> String
showsPrec :: Int -> DCInfo -> ShowS
$cshowsPrec :: Int -> DCInfo -> ShowS
Show)
infoToTag :: DCInfo -> Text
infoToTag :: DCInfo -> Text
infoToTag DCInfo
i =
case DCInfo
i of
DCInfo
DC_Title -> Text
"title"
DCInfo
DC_Creator -> Text
"creator"
DCInfo
DC_Subject -> Text
"subject"
DCInfo
DC_Description -> Text
"description"
DCInfo
DC_Publisher -> Text
"publisher"
DCInfo
DC_Contributor -> Text
"contributor"
DCInfo
DC_Date -> Text
"date"
DCInfo
DC_Type -> Text
"type"
DCInfo
DC_Format -> Text
"format"
DCInfo
DC_Identifier -> Text
"identifier"
DCInfo
DC_Source -> Text
"source"
DCInfo
DC_Language -> Text
"language"
DCInfo
DC_Relation -> Text
"relation"
DCInfo
DC_Coverage -> Text
"coverage"
DCInfo
DC_Rights -> Text
"rights"
DC_Other Text
o -> Text
o
dc_element_names :: [Text]
dc_element_names :: [Text]
dc_element_names =
[ Text
"title"
, Text
"creator"
, Text
"subject"
, Text
"description"
, Text
"publisher"
, Text
"contributor"
, Text
"date"
, Text
"type"
, Text
"format"
, Text
"identifier"
, Text
"source"
, Text
"language"
, Text
"relation"
, Text
"coverage"
, Text
"rights"
]